forked from dhruvjain99/mzbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmpp_p2p.bdl
36 lines (29 loc) · 1.43 KB
/
xmpp_p2p.bdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!benchDL
make_install(git = "https://github.com/gojekfarm/mzbench.git",
dir = "workers/xmpp")
pool(size = numvar("users-number", 1000),
worker_type = xmpp_worker,
worker_start = linear(numvar("user-rps", 500) rps)):
# connect to xmpp.example.com:5222 server and
# use domain.example.com as domain
# use user_{pool_id} as nickname
connect(iname("user", pool_id()),
"domain.example.com",
"xmpp.example.com",
5222)
# send initial presence
initial_presence()
# wait until everyone is connected to the xmpp server
set_signal(init, 1)
wait_signal(init, numvar("users-number", 1000))
# spawn stream parser in the seperate thread and enable message's latency and count parsers
spawn_stream_parser(0, 60000, [t(histogram),
t(message),
t(errors)])
# send a private message to random user but me
loop(time = numvar("duration", 5) min,
rate = ramp(linear, numvar("min-msgs-rps", 1) rps,
numvar("max-msgs-rps", 10) rps))
send_message(recipient("user", numvar("users-number", 1000)), marker(50), skip)
# close socket and halt stream parser
close()