Skip to content

perf: watch-set cache hit/miss telemetry for validating savings in the field #123

Description

@zackees

Follow-up from #120.

DaemonWatchSetCache currently has zero observability — a user who enables the cache has no way to tell whether it actually short-circuited the fp-watches-collect walk on their project. For tuning the freshness window (#122) and diagnosing stale-hit confusion, we should emit counters.

Scope:

  • On get: emit tracing::debug!(target: "fbuild_daemon::watch_set_cache", hit = true|false, key_hash, age_ms, "watch-set cache lookup").
  • Aggregate cumulative hit / miss counters on DaemonContext exposed via /api/daemon/info (already the home for similar aggregate stats).
  • Add an integration test that runs two back-to-back builds and asserts the second one bumps the hit counter.

Non-goals:

  • No Prometheus / OTLP export. Plain tracing + JSON field on /api/daemon/info is enough for now.

Related: #120 (the cache), #91 (warm-build instrumentation).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions