Skip to content

Start the Zinc counter where production starts - #44

Merged
noha merged 1 commit into
mainfrom
zinc-counter-starts-where-production-starts
Sep 17, 2026
Merged

noha merged 1 commit into
mainfrom
zinc-counter-starts-where-production-starts

Conversation

@noha

@noha noha commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Comparing both exports line by line turned up two differences in the counter, one of them not a difference but a defect: a fresh counter answered nil for the average duration, and nil is not a value a Prometheus scrape can parse. Before the first request, Canopy's endpoint would have served a broken line.

The second: pharo-metrics seeds fifteen status codes with zero, so those series exist from the first scrape. Canopy started with an empty map, so zinc_httpResponses was absent until the first response of a kind arrived - and a counter that starts existing halfway through the day reads differently from one that starts at zero.

Both now start where production starts. That makes the nil guard in adjustDuration: unreachable, and with it the first request no longer sets the baseline but moves the average by a hundredth - which is what the servers have been exporting all along. The test said it mirrored pharo-metrics and did not; it does now.

Comparing both exports line by line turned up two differences in the counter,
one of them not a difference but a defect: a fresh counter answered nil for
the average duration, and nil is not a value a Prometheus scrape can parse.
Before the first request, Canopy's endpoint would have served a broken line.

The second: pharo-metrics seeds fifteen status codes with zero, so those
series exist from the first scrape. Canopy started with an empty map, so
zinc_httpResponses was absent until the first response of a kind arrived -
and a counter that starts existing halfway through the day reads differently
from one that starts at zero.

Both now start where production starts. That makes the nil guard in
adjustDuration: unreachable, and with it the first request no longer sets the
baseline but moves the average by a hundredth - which is what the servers
have been exporting all along. The test said it mirrored pharo-metrics and
did not; it does now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@noha
noha merged commit b9b9a4b into main Sep 17, 2026
4 checks passed
@noha
noha deleted the zinc-counter-starts-where-production-starts branch September 18, 2026 06:19
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