mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 12:45:47 +01:00
cargo build builds plugin
And benchmark for virtual plugin
This commit is contained in:
parent
635d1a052d
commit
1aad99fdee
3 changed files with 91 additions and 1 deletions
|
|
@ -80,3 +80,7 @@ members = ["plugins/reaction-plugin", "plugins/reaction-plugin-virtual"]
|
|||
remoc = { version = "0.18.3" }
|
||||
serde = { version = "1.0.203", features = ["derive"] }
|
||||
tokio = { version = "1.40.0" }
|
||||
|
||||
[[bin]]
|
||||
name = "reaction-plugin-virtual"
|
||||
path = "plugins/reaction-plugin-virtual/src/main.rs"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ then
|
|||
fi
|
||||
|
||||
rm -f reaction.db
|
||||
cargo build --release
|
||||
cargo build --release --bins
|
||||
sudo systemd-run --wait \
|
||||
-p User="$(id -nu)" \
|
||||
-p MemoryAccounting=yes \
|
||||
|
|
|
|||
86
bench/small-heavy-load-virtual.yml
Normal file
86
bench/small-heavy-load-virtual.yml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
---
|
||||
# This configuration permits to test reaction's performance
|
||||
# under a very high load
|
||||
#
|
||||
# It keeps regexes super simple, to avoid benchmarking the `regex` crate,
|
||||
# and benchmark reaction's internals instead.
|
||||
concurrency: 32
|
||||
|
||||
plugins:
|
||||
- path: "/home/ppom/prg/reaction/target/release/reaction-plugin-virtual"
|
||||
|
||||
patterns:
|
||||
num:
|
||||
regex: '[0-9]{3}'
|
||||
ip:
|
||||
regex: '(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3})|(?:[0-9a-fA-F:]{2,90})'
|
||||
ignore:
|
||||
- 1.0.0.1
|
||||
|
||||
streams:
|
||||
virtual:
|
||||
type: virtual
|
||||
filters:
|
||||
find0:
|
||||
regex:
|
||||
- '^<num>$'
|
||||
actions:
|
||||
damn:
|
||||
cmd: [ 'sleep', '0.0<num>' ]
|
||||
undamn:
|
||||
cmd: [ 'sleep', '0.0<num>' ]
|
||||
after: 1m
|
||||
onexit: false
|
||||
tailDown1:
|
||||
cmd: [ 'sh', '-c', 'sleep 2; seq 1001 | while read i; do echo found $i; done' ]
|
||||
filters:
|
||||
find1:
|
||||
regex:
|
||||
- '^found <num>'
|
||||
retry: 9
|
||||
retryperiod: 6m
|
||||
actions:
|
||||
virtual:
|
||||
type: virtual
|
||||
options:
|
||||
send: '<num>'
|
||||
to: virtual
|
||||
tailDown2:
|
||||
cmd: [ 'sh', '-c', 'sleep 2; seq 100100 | while read i; do echo found $i; echo trouvé $i; done' ]
|
||||
filters:
|
||||
find2:
|
||||
regex:
|
||||
- '^found <num>'
|
||||
retry: 480
|
||||
retryperiod: 6m
|
||||
actions:
|
||||
virtual:
|
||||
type: virtual
|
||||
options:
|
||||
send: '<num>'
|
||||
to: virtual
|
||||
tailDown3:
|
||||
cmd: [ 'sh', '-c', 'sleep 2; seq 100100 | while read i; do echo found $i; echo trouvé $i; done' ]
|
||||
filters:
|
||||
find3:
|
||||
regex:
|
||||
- '^found <num>'
|
||||
retry: 480
|
||||
retryperiod: 6m
|
||||
actions:
|
||||
virtual:
|
||||
type: virtual
|
||||
options:
|
||||
send: '<num>'
|
||||
to: virtual
|
||||
find4:
|
||||
regex:
|
||||
- '^trouvé <num>'
|
||||
retry: 480
|
||||
retryperiod: 6m
|
||||
actions:
|
||||
virtual:
|
||||
type: virtual
|
||||
options:
|
||||
send: '<num>'
|
||||
to: virtual
|
||||
Loading…
Add table
Add a link
Reference in a new issue