Skip to content

metrics: one histogram comparator, one period constructor - #173

Merged
trick77 merged 3 commits into
masterfrom
metrics-shared-helpers
Nov 19, 2026
Merged

trick77 merged 3 commits into
masterfrom
metrics-shared-helpers

Conversation

@trick77

@trick77 trick77 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

stageHistogram and histogram share one BinarySearchFunc comparator, edgeAbove. ClosedPeriod, ClosedPrevious and PreviousPeriod are whole weeks ending at a Monday and now go through weeksBefore, which takes that end; the exported names stay. NewPeriod ends at now, mid-week, so it keeps periodFrom.

No behaviour change: Compute/Assess JSON from every test fixture (metrics, analysis, api, dataset over real Postgres), a sweep of all four period constructors (1,036,600 cases: 10 zones incl. midnight-DST ones, 2008-2030, windows 1/2/4/12/26) and 5,148 histogram probes (every edge, its neighbours, NaN, Inf) recorded before and after: identical, apart from rows' insert timestamps.

@trick77
trick77 force-pushed the metrics-shared-helpers branch from 3dd322c to a2f5767 Compare November 19, 2026 08:30
Deps.TeamNames and the teams handler sorted the configured teams themselves; config.Config.TeamNames already does.
Compute, Assess and build defaulted a nil previous dataset or baseline;
production always passes a loaded previous period (api read, analysis
assess). The default moved into the tests' noPrevious and buildAlone;
behaviour unchanged.
stageHistogram and histogram share edgeAbove. ClosedPeriod, ClosedPrevious and PreviousPeriod are whole weeks ending at a Monday: weeksBefore takes that end. NewPeriod ends at now, mid-week, so it keeps periodFrom.
@trick77
trick77 force-pushed the metrics-shared-helpers branch from a2f5767 to d450c37 Compare November 19, 2026 08:41
@trick77
trick77 merged commit d450c37 into master Nov 19, 2026
1 check passed
@trick77
trick77 deleted the metrics-shared-helpers branch November 19, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant