querybench

command
v0.3.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Command querybench is a stdlib-only query load generator for TinyRaven pipe endpoints. Where scripts/loadtest measures the ingestion path (events/s), this measures the read path: how fast published pipes answer under concurrency.

It spins up N workers, each looping for a fixed duration issuing GET /v0/pipes/<pipe>.json?<param> with a bearer token, and reports query throughput plus latency percentiles. Two latencies are tracked:

  • client wall latency (full HTTP round trip, p50/p95/p99)
  • ClickHouse server-side time, parsed from the response body's statistics.elapsed (FORMAT JSON), reported p50/p95 when present

The -distinct flag controls the working set of param values, which is how we separate cached from uncached latency. Pipes opt into ClickHouse's query_cache via CACHE_TTL (ADR 0009); repeated identical-param queries then hit the cache:

-distinct 1      all requests share one param value -> max cache hits (cached)
-distinct 100000 values rarely repeat -> mostly cache misses (uncached)

Usage:

go run ./scripts/querybench \
  -url http://localhost:8010 -token "$TR_READ_TOKEN" \
  -pipe user_metrics -params user_id=u -workers 50 -duration 15s -distinct 1

See docs/benchmark.md for methodology and the reference figures.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL