The answer's metric names identify the document - #178
Merged
Conversation
`--using` was the only way to get a unit when the window held no `!meta`,
which meant typing the name of a document whose metrics are already
listed in the answer. So `facts_for` looks it up instead: for each metric,
which locally installed documents declare it.
Three sources, in order of authority — the document `using` NAMED, then a
`!meta` (the producer's own word about these numbers), then the local
documents. `using` becomes the override.
⚠ Inference degrades to NO unit, never a wrong one. Two documents
declaring one metric in different units are both named and the unit is
left blank, because the unit decides which axis a series lands on:
guessing between `ms` and `s` would not mislabel a plot, it would regroup
it. Live today — `timberfs-apache-combined` and `-nginx-combined` share
`http_requests` and `http_bytes` at identical units, while `http_latency`
is nginx's alone at `s` and apache logs `%{ms}T` in milliseconds.
Two things it now says that were silent: a `using` naming a document that
declares none of the answer's metrics, and a `using` that disagrees with
a `!meta`.
And the test harness catches per test, as the timbersh one does. Unguarded
it aborted the whole run on an exception, so every test after the raising
one never ran — which is the failure mode a suite exists to prevent, and
it hid this test's own first draft.
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.
--usingwas the only route to a unit when the window held no!meta— whichmeant typing the name of a document whose metrics are already listed in the
answer.
facts_forlooks it up instead.Three sources, in order of authority: the document
usingnamed (aninstruction), then a
!metain the window (the producer's own word about thesenumbers), then the documents installed here. So
usingbecomes theoverride rather than the normal path.
Live, with no
!metaand no--using— the inferredrequestsreaches theright axis and splits the plot, which is the unit-decides-the-axis rule working
off inference alone:
⚠ Inference degrades to NO unit, never a wrong one. Where two documents
declare one metric in different units, both are named and the unit is left
blank. The unit decides which axis a series lands on, so guessing between
msand
swould not mislabel a plot — it would regroup it.That is not hypothetical. The shipped set today:
The two overlapping metrics agree, so the ambiguity is currently harmless — and
checkable rather than assumed. But
http_latencyis nginx's alone atswhile apache logs
%{ms}Tin milliseconds, so the first timetimberfs-apache-combinedgrows a latency metric (the field is already in thelog format it parses) a mistyped
usingwould silently re-axis the plot.Two things now said that were silent: a
usingnaming a document thatdeclares none of the answer's metrics, and a
usingthat disagrees with a!meta.Nothing new in the bark, nothing that travels, no dependency on the producing
host being alive — the only requirement is the one this rests on anyway: the
local documents resemble the server's. When they don't it degrades to no units,
which is exactly today's behaviour.
The harness bug this turned up
tests/timbergraph/test-timbergraph'smain()calledfn()unguarded, so onetest raising aborted the whole run and every test after it never ran — the
failure mode a suite exists to prevent. It hid the first draft of this PR's own
test (a
KeyErrorthat read as a clean pass in a truncated check). Now caughtper test, as the timbersh suite already does. Verified by sabotaging
declaring():New in
timbergraph.py:declaring(metric)andfacts_for(metrics, markers, using), which replaces the three-line facts/units dance duplicated intimbergraph'smain()and timbersh'sgraph.