Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make events per call configurable with P_EVENTS_COUNT #51

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions quest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
vus = "10"
duration = "5m"
schema_count = "20"
events_count = "10"
)

func TestSmokeListLogStream(t *testing.T) {
Expand Down Expand Up @@ -238,6 +239,7 @@ func TestLoadStreamBatchWithK6(t *testing.T) {
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.Password),
"-e", fmt.Sprintf("P_STREAM=%s", NewGlob.Stream),
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count),
"-e", fmt.Sprintf("P_EVENTS_COUNT=%s", schema_count),
"./scripts/load_batch_events.js",
"--vus=", vus,
"--duration=", duration)
Expand Down
12 changes: 11 additions & 1 deletion scripts/load_batch_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function schemas() {
return Number(__ENV.P_SCHEMA_COUNT)
}

function events_per_call() {
return Number(__ENV.P_EVENTS_COUNT)
}

const common_schema = [
{ "name": "source_time", "gen": current_time, "arg": null },
{ "name": "level", "gen": randomItem, "arg": ["info", "warn", "error"] },
Expand Down Expand Up @@ -168,7 +172,13 @@ export default function () {
}
}

let batch_requests = JSON.stringify(generateEvents(1000));
let events = events_per_call();

if (!events) {
events = 10
}

let batch_requests = JSON.stringify(generateEvents(events));
let response = http.post(url, batch_requests, params);

if (
Expand Down