From 29244c4ebd02a3c12c41b47faca5fffc39ace355 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Thu, 8 Feb 2024 15:34:58 +0100 Subject: [PATCH 1/2] microbenchmarks/logging: Fix running with terminate flag set Previously, these benchmarks would run after Zeek has decided to shut down, making Zeek's internal batching ineffective. --- ci-based/scripts/microbenchmarks/logging/one-stream.zeek | 6 +++++- ci-based/scripts/microbenchmarks/logging/two-streams.zeek | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ci-based/scripts/microbenchmarks/logging/one-stream.zeek b/ci-based/scripts/microbenchmarks/logging/one-stream.zeek index 2422963..b3a6d63 100644 --- a/ci-based/scripts/microbenchmarks/logging/one-stream.zeek +++ b/ci-based/scripts/microbenchmarks/logging/one-stream.zeek @@ -1,5 +1,7 @@ @load base/frameworks/logging +redef exit_only_after_terminate = T; + redef enum Log::ID += { LOG }; type Info: record { @@ -8,7 +10,7 @@ type Info: record { vec: vector of count; }; -global n = 1000000; +global n = 3000000; global gmsg = ""; global gvec = vector(1, 2, 3); @@ -18,6 +20,8 @@ event do_log(n: count) if (--n > 0) event do_log(n); + else + terminate(); } event zeek_init() diff --git a/ci-based/scripts/microbenchmarks/logging/two-streams.zeek b/ci-based/scripts/microbenchmarks/logging/two-streams.zeek index e12f2d9..8909681 100644 --- a/ci-based/scripts/microbenchmarks/logging/two-streams.zeek +++ b/ci-based/scripts/microbenchmarks/logging/two-streams.zeek @@ -1,5 +1,7 @@ @load base/frameworks/logging +redef exit_only_after_terminate = T; + redef enum Log::ID += { LOG, LOG2 }; type Info: record { @@ -8,7 +10,7 @@ type Info: record { vec: vector of count; }; -global n = 1000000; +global n = 3000000; global gmsg = ""; global gvec = vector(1, 2, 3); @@ -19,6 +21,8 @@ event do_log(n: count) if (--n > 0) event do_log(n); + else + terminate(); } event zeek_init() From b1c0621088243880631ace8f2ab10fd9c51e3e20 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Thu, 8 Feb 2024 16:44:36 +0100 Subject: [PATCH 2/2] config-tests: Add websocket pcap tests These were created by tunneling various traffic with wstunnel (HTTP downloads and SSH uploads and a tiny bit of SSL). Hook up the both, BinPac and Spicy versions to see improvements or regressions in Spicy over time. Here these run in 8.3 vs 14.4 seconds runtime, with bare mode taking some 3.5 seconds to process the pcap. --- ci-based/config-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci-based/config-tests.yml b/ci-based/config-tests.yml index ab3f55d..ed2d047 100644 --- a/ci-based/config-tests.yml +++ b/ci-based/config-tests.yml @@ -41,6 +41,13 @@ ZEEK_TESTS: - id: pcap-quic-12k pcap_file: quic-12k-connections.pcap + - id: pcap-websocket-traffic-mix + pcap_file: websocket-traffic-mix.pcap + + - id: pcap-spicy-websocket-traffic-mix + pcap_file: websocket-traffic-mix.pcap + pcap_args: 'WebSocket::use_spicy_analyzer=T' + - id: micro-misc-zeek-version bench_command: /benchmarker/scripts/tiny-benchmark.sh bench_args: -D -b microbenchmarks/misc/zeek-version.zeek