Skip to content

Add metrics collector unit tests #29

Description

@BennettSchwartz

Summary

pkg/metrics/metrics.go computes several aggregate metrics but currently has no unit test coverage.

Why this is a good first issue

  • Good exposure to record schema and observability outputs.
  • Can be tested with a lightweight fake store.
  • No API contract changes required.

Proposed work

Add pkg/metrics/metrics_test.go that validates:

  • Basic aggregation (TotalRecords, RecordsByType, averages, salience buckets).
  • RFC 15.10 derived fields (MemoryGrowthRate, RetrievalUsefulness, RevisionRate, etc.).
  • Empty-record behavior.
  • Error path when store List fails.

Acceptance criteria

  • Tests pass with go test ./pkg/metrics.
  • Snapshot fields are asserted with deterministic fixtures.
  • Both success and failure paths are covered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions