Skip to content

Commit bdb7e04

Browse files
committed
sentry - benchmark - Add multiple events lua script
1 parent 6aee22f commit bdb7e04

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

sentry/benchmark/multiple_benchmark.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- Multiple campaigns with a single event in the request
2+
--
13
-- This script will submit events for 3 campaigns
24
-- The 3 campaigns can be found in `primitives::test_util`
35
wrk.method = "POST"
@@ -7,7 +9,6 @@ wrk.headers["Content-Type"] = "application/json"
79
-- uses the DUMMY_AUTH[CREATOR] token
810
-- wrk.headers["authorization"] = "Bearer AUTH_awesomeCreator:chain_id:1337"
911

10-
1112
init = function(args)
1213
local r = {}
1314

sentry/benchmark/multiple_events.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
-- Multiple events to multiple campaigns
2+
--
3+
-- This script will submit events for 3 campaigns
4+
-- The 3 campaigns can be found in `primitives::test_util`
5+
-- Each requests consist of 2 events - IMPRESSION & CLICK
6+
-- and each event has differnet publihser (PUBLIHSER & PUBLISHER_2) as well as different AdUnit & AdSlot
7+
-- The same events are used for all campaigns.
8+
wrk.method = "POST"
9+
-- uses the PUBLISHER (for IMPRESSION) & PUBLISHER_2 (for CLICK) address
10+
wrk.body = "{ \"events\": [ {\"type\": \"IMPRESSION\", \"publisher\": \"0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9\", \"adUnit\": \"Qmasg8FrbuSQpjFu3kRnZF9beg8rEBFrqgi1uXDRwCbX5f\", \"adSlot\": \"QmcUVX7fvoLMM93uN2bD3wGTH8MXSxeL8hojYfL2Lhp7mR\"} ] }"
11+
wrk.headers["Content-Type"] = "application/json"
12+
-- uses the DUMMY_AUTH[CREATOR] token
13+
-- wrk.headers["authorization"] = "Bearer AUTH_awesomeCreator:chain_id:1337"
14+
15+
16+
init = function(args)
17+
local r = {}
18+
19+
-- with 2 different publishers (PUBLISHER, PUBLISHER_2), different AdUnits & different AdSlots
20+
local two_events_body = "{ \"events\": [ {\"type\": \"IMPRESSION\", \"publisher\": \"0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9\", \"adUnit\": \"Qmasg8FrbuSQpjFu3kRnZF9beg8rEBFrqgi1uXDRwCbX5f\", \"adSlot\": \"QmcUVX7fvoLMM93uN2bD3wGTH8MXSxeL8hojYfL2Lhp7mR\"}, {\"type\": \"CLICK\", \"publisher\": \"0x0e880972A4b216906F05D67EeaaF55d16B5EE4F1\", \"adUnit\": \"QmQnu8zrHsuVvnTJsEgDHYA8c1MmRL7YLiMD8uzDUJKcNq\", \"adSlot\": \"QmYYBULc9QDEaDr8HAXvVWHDmFfL2GvyumYRr1g4ERBC96\"} ] }"
21+
22+
-- Campaign 1
23+
r[1] = wrk.format(nil, "/v5/campaign/0x936da01f9abd4d9d80c702af85c822a8/events", nil, two_events_body)
24+
-- Campaign 2
25+
r[2] = wrk.format(nil, "/v5/campaign/0x127b98248f4e4b73af409d10f62daeaa/events", nil, two_events_body)
26+
-- Campaign 3
27+
r[3] = wrk.format(nil, "/v5/campaign/0xa78f3492481b41a688488a7aa1ff17df/events", nil, two_events_body)
28+
29+
req = table.concat(r)
30+
end
31+
32+
request = function()
33+
return req
34+
end

0 commit comments

Comments
 (0)