Skip to content

Observation cache and measurement state #36

Closed

Description

@somethingwithproof

Summary

Values are served only when the plugin can vouch for them.

Requirements

  • REQ-STATE-001 The cache MUST store, per resource and metric, the newest complete datapoint, its provider timestamp, and the fetch time.
  • REQ-STATE-002 Freshness MUST be computed from the datapoint time against the metric's period, delay, and the collection interval.
  • REQ-STATE-003 Collection, lifecycle, administrative, maintenance, and credential states MUST be recorded as in the plan.
  • REQ-STATE-004 A missing, stale, over-budget, or inactive value MUST read as unknown, never as zero.
  • REQ-STATE-005 Clock skew beyond a fixed allowance MUST make values unknown with reason clock_skew.

Acceptance criteria

  • Freshness tests with a fixed clock for every boundary.

References

Dependencies

Activity

  1. added
    type: requirementA testable behavior the plugin must have
    area: collectionCollector job, discovery, and the observation cache
    area: alertingScript server values, Thold, Maint, and staleness
    on Nov 14, 2026
  2. somethingwithproof commented on Nov 15, 2026

    @somethingwithproof
    OwnerAuthor

    Done in #81, but the PR didn't close this issue. The acceptance criterion is met on main: tests/Unit/FreshnessTest.php uses a FixedClock to test both sides of every boundary, current/delayed at 480/481 s, delayed/stale at 960/961 s and current/clock skew at -120/-121 s. It also covers never-observed series and NULL, empty and malformed rows. #85 adds FreshnessEvaluator::state(), shared by the health page and the script server, with tests for every state.

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

    area: alertingScript server values, Thold, Maint, and stalenessarea: collectionCollector job, discovery, and the observation cachephase: 1 coreCore and DigitalOceanpriority: highNeeded for its milestonetype: requirementA testable behavior the plugin must have

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions