github robintra/perf-sentinel v0.4.1

latest releases: chart-v0.2.46, v0.8.1, chart-v0.2.45...
one month ago

What's new in v0.4.1

Patch release: makes config loading robust on Windows, adds soft startup warnings for unusual daemon-limit values and tightens the bench percentile calculation. No breaking changes.

New

  • Startup comfort-zone warnings for daemon limits. validate_daemon_limits and validate_detection_params now emit a one-shot tracing::warn! when max_payload_size, max_active_traces, max_events_per_trace, max_retained_findings, trace_ttl_ms, or max_fanout falls outside its recommended comfort zone (e.g. max_active_traces outside 1,000-100,000). The warning includes the field name, the value, the boundary crossed, and a one-line explanation of the practical consequence (eviction pressure, ingest latency, detection noise...). Hard caps are unchanged: values inside the hard bounds still parse successfully, the warning is informational only. A new config_defaults_sit_inside_every_comfort_zone test locks the invariant that Config::default() never triggers a startup warning.

Fixes

  • Windows-style config paths in TOML basic strings. New normalize_toml_path_strings pre-processor in config.rs rewrites bare backslashes inside path-keyed values (hourly_profiles_file, calibration_file, json_socket, tls_cert_path, tls_key_path) so json_socket = "C:\temp\sock" parses as a literal path instead of triggering a TOML escape error. Already-escaped pairs (C:\\temp\\sock), TOML literal strings ('C:\temp\sock'), and UNC prefixes (\\server\share) round-trip correctly. Falls back transparently to the original input if normalization breaks parsing, with a tracing::debug! line for diagnosability.
  • max_retained_findings was unbounded. A typo like max_retained_findings = 999999999999 would have OOM-ed the daemon at the first stored finding. Now capped at 10,000,000 (with 0 still documented to disable the store entirely).
  • Bench p99 off-by-one. compute_latency_percentiles was computing p99_idx = ceil(len * 0.99) (1-based rank) and indexing into the 0-based vector, biasing the reported p99 by one position. Now correctly subtracts 1 with saturating_sub. The function also guards against empty slices (returns (0.0, 0.0)) and bounds p50_idx symmetrically with p99_idx.
  • Daemon-only build broke after feature = "tempo" gating regression. spawn_one_shot_server, http_200_text, and http_status in test_helpers.rs are now gated under any(feature = "daemon", feature = "tempo") so cargo check --features daemon (without tempo) keeps compiling. http_200_bytes stays under tempo only since it is the only consumer.

Refactors

  • escape_toml_path_backslashes split into three named helpers (copy_until_backslash, skip_backslash_run, backslash_emit_len) to bring SonarCloud cognitive complexity from 20 to under 15.
  • find_basic_string_end rewritten with a linear consecutive-backslash counter instead of a per-quote backward lookbehind. Closes a worst-case O(n²) on inputs full of \. A regression test feeds it a 10,000-backslash run.

Hardening

  • UTF-8 safety in normalize_toml_path_line. The opening " is now pushed explicitly instead of relying on an inclusive byte-range slice that could panic on a multi-byte char before the value.

Tests

  • 21 new tests across config.rs and the bench percentile module: UNC paths (raw + pre-escaped), inline comments after path values, every entry of TOML_PATH_STRING_KEYS, TOML literal strings, fallback branch, pathological 10k-backslash input, percentile edges (n=1, n=2, n=101, empty), comfort-zone behavior on each daemon limit, max_retained_findings = 0 keeps disabling the store, and the defaults-in-comfort-zone invariant.

Docs

  • docs/CONFIGURATION.md and docs/FR/CONFIGURATION-FR.md: hard ranges added to each [daemon] field row, new "Comfort zones and startup warnings" sub-section with a band table per field.
  • docs/design/07-CLI-CONFIG-RELEASE (EN + FR): bench percentile snippet updated to reflect the off-by-one fix.

Install

# Prebuilt binaries (Linux amd64/arm64, macOS arm64, Windows amd64)
curl -LO https://github.com/robintra/perf-sentinel/releases/download/v0.4.1/perf-sentinel-linux-amd64
chmod +x perf-sentinel-linux-amd64
sudo mv perf-sentinel-linux-amd64 /usr/local/bin/perf-sentinel
# From crates.io
cargo install perf-sentinel
# Docker
docker pull robintrassard/perf-sentinel:0.4.1

Also available on GHCR: ghcr.io/robintra/perf-sentinel:0.4.1

Verify the binary against SHA256SUMS.txt:

curl -LO https://github.com/robintra/perf-sentinel/releases/download/v0.4.1/SHA256SUMS.txt
sha256sum -c SHA256SUMS.txt --ignore-missing

Full diff: v0.4.0...v0.4.1

Don't miss a new perf-sentinel release

NewReleases is sending notifications on new releases.