Repository navigation
metrics: one histogram comparator, one period constructor - #173
Merged
Merged
Conversation
trick77
force-pushed
the
metrics-shared-helpers
branch
from
November 19, 2026 08:30
3dd322c to
a2f5767
Compare
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
force-pushed
the
metrics-shared-helpers
branch
from
November 19, 2026 08:41
a2f5767 to
d450c37
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.