Tab completes a metric name, and an extractor name - #177
Merged
Conversation
`graph <TAB>` offered nothing. The metric is typed BEFORE `from`, so the completer has no store to ask — but the extractor documents installed here DECLARE the metric names, and reading them costs 121 us, so the slot now offers those. `using` and `extracting` take the file stems from the same directories. ⚠ A candidate set, not the truth: a tally store holds whatever metrics the host that wrote it applied, which need not be what is installed locally. A hint from the documents beats the nothing this offered. Not cached, deliberately. The workflow is writing a document and trying it from the shell, and a cache would mean restarting timbersh after editing your own extractor. The test passes the directories rather than deriving them — deriving them measures whether the timberfs package happens to be installed, which is the trap the Rust twin fell into this evening.
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.
graph <TAB>offered nothing. Reported from actually using 0.9.0.Why the slot was empty rather than merely forgotten. The metric is typed
before
from <source>, so at completion time there is no store to ask — whichis presumably why
<metric>was left inoffers()'s "anything, so offernothing" bucket alongside a count or a time.
But the extractor documents installed here declare the metric names, and
reading all of them costs 121 µs. So the slot now offers those:
usingandextractingget the same treatment from the same directories — theytake the file stems, which is what the lookup joins
.jsononto, not thedocuments' own names, which can differ and would not resolve.
Both sides of
graph Y against Xare the same slot, so the scatter formcompletes without a second entry in
FORMS.Two decisions worth stating.
⚠ It is a candidate set, not the truth. A tally store holds whatever metrics
the host that wrote it applied, which need not be what is installed locally — so
completion can miss a metric and can offer one the store lacks. A hint from the
documents beats the nothing that was there.
⚠ Not cached, deliberately. At 121 µs there is nothing to save, and the
workflow this exists for is writing a document and trying it from the shell — a
cache would mean restarting timbersh after editing your own extractor.
New in
timbergraph.py:declared()(every document in the readingdirectories, later shadowing earlier by filename, a half-written one skipped
rather than fatal),
known_metrics()andknown_extractors().The test passes the directories rather than deriving them, patching
EXTRACTOR_DIRS— deriving them measures whether the timberfs package happensto be installed on the runner, which is exactly the trap #174's Rust twin fell
into and #176 fixed.