feat: add the tsdb benchmark subject #7
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
zoo/eve!7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/tsdb-benchmarks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a criterion subject
tsdbthat compares the time-series store across the two deployment profiles: NATS + ClickHouse and in-process fjall + Parquet.What it measures
Direct port comparison (no broker):
tsdb insert— 1 and 1,000 rows, ClickHouse vs Parquet; the table is cleared outside the timer.tsdb query— 10,000 seeded rows,value=gt=5000, sort+date, limit 100; the seed is outside the timer.tsdb purge— 1,000 seeded rows,id=lt="00000500"; the seed is outside the timer and the remaining 500 rows are asserted.Full persistent projection:
tsdb persistent projection— persistentCREATEmessages are published toEntityProjectTsdbUnitover NATS + ClickHouse and over inproc + Parquet; 1 and 100 messages per iteration. The timer covers publish + projection +TsdbUnit::insert; it ends when the expected row count is visible, so the polling latency of the asynchronous projection is included (the port has no completion event).Skip rules
CLICKHOUSE_URL.NATS_URLandCLICKHOUSE_URL.TempDir.Local quick results (no services,
cargo bench -p eve_e2e -- tsdb --quick)The network half was not run here because NATS/ClickHouse are not up. With the backends:
Docs
eve_e2e/benches/bench.rs: registers the ninth subject.adr/bench.md: describes the direct and full-stack comparisons, the skip rules and the polling caveat.README.md: subject list, example command and backend variables.Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo bench -p eve_e2e -- tsdb --quick(local halves; network halves skip cleanly)cargo test -p eve_e2e --test broker --test db --test tsdb --test storage --test app— all pass.Network half is up (existing
eve-natsandeve-clickhousecontainers: NATS 2.10, ClickHouse 25.2.2) and both halves now run. This also caught a real benchmark bug: the schema had norequiredfields, so ClickHouse 25 rejected the nullable sorting key; fixed by adding"required": ["id", "date", "value"](commit51b1137).Command:
Results (median)
tsdb insert/1tsdb insert/1000tsdb insert/1000throughputtsdb query(10k seeded, filter+sort+limit)tsdb purge(1k seeded, 500 removed)tsdb persistent projection/1tsdb persistent projection/100tsdb persistent projection/100throughputInterpretation
insertlatency is dominated by the adapter'sasync_insert=1path: the one-row and 1,000-row batches both take ~58 ms, which matches ClickHouse's adaptive async-insert flush timeout (async_insert_busy_timeout_ms=200, min 50 ms). So the 1-row comparison is a fixed flush-wait comparison, not a storage comparison; the 1,000-row throughput is the useful storage number.ALTER DELETE+OPTIMIZEmutation.TsdbUnitport has no completion event. Both halves pay the same polling latency.These are single-run numbers on a shared host; use
--save-baseline/--baselinefor regression comparisons. The benchmark wipes NATS streams and ClickHouse tables on start, like the e2e suite.