-
Notifications
You must be signed in to change notification settings - Fork 0
Blueprint 06 Telemetry
Dmdv edited this page Jul 11, 2026
·
1 revision
Source:
docs/blueprint/06-telemetry.mdin the main repository.
If you only track mean latency, you will ship a system that fails in production.
HFT and ULL systems live and die on tails.
| Topic | Module / tool |
|---|---|
| Cycle counters |
ll::read_tsc() (RDTSC / cntvct_el0) |
| Wall-ish mono ns | ll::steady_ns() |
| Fixed sample buffer | ll::LatencyBuffer<N> |
| HDR-style histogram |
ll::HdrLatencyHistogram — p50/p99/p99.9/max |
| Google Benchmark |
bench_queues (optional package) |
| HdrHistogram_c | Production-grade upgrade path (DOC) |
perf PMCs |
Operator guide below |
./build/example_hdr
make bench#include "ll/tsc_clock.hpp"
const auto t0 = ll::read_tsc();
do_work();
const auto dt = ll::read_tsc() - t0;| Platform | Counter |
|---|---|
| x86_64 | __rdtsc() |
| aarch64 | cntvct_el0 |
| fallback |
steady_clock ns |
Caveat: compare cycle counts only with a pinned thread on a stable frequency domain.
ll::LatencyBuffer<1<<20> hist;
hist.try_push(delta_ns); // never allocates
// after run: sort copy → percentiles| Metric | Why |
|---|---|
| p50 | Typical case |
| p99 | Common SLO language |
| p99.9 / max | Outliers that blow risk limits |
Mean is a vanity metric when the distribution is heavy-tailed.
perf stat -e cycles,instructions,cache-misses,branch-misses ./app
perf record -e cycles:u ./app && perf reportWatch:
- IPC (instructions per cycle)
- cache-misses
- branch-misses
- context-switches / migrations (OS noise)
- Prevent DCE: use
volatile/DoNotOptimizesinks - Warm up code and data pages
- Pin threads before measuring
- Prefer distribution reports over single-number “ns/op”
examples/tsc/main.cpp-
[ll][tsc]intests/test_ll_modules.cpp
- HDR histogram (no alloc, compressed bins)
- Optional integration with
perfcounters viaperf_event_openon Linux
Wiki mirror of repository docs. Edit docs/ in the main repo, then python3 scripts/publish_wiki.py.