Repository navigation
Conversation
- download: refetch a past month's local file unless it was saved at least one day after that month ended; "now" is injectable for tests - merge_months: error naming the statistic, months and outputs when months disagree on their outputs, instead of using the first month's outputs - parse_index: skip a malformed <li> entry and continue with the next - get/download: reject --from later than --to - stats list: add the `ls` alias - tests: fuzzy "Did you mean" suggestion, out-of-order index months, --no-header for get CSV and the list table; invented fixture names - docs: correct the Statistics notes in COMMANDS.md and replace the stale `lox stats` section in docs/commands/inspection.md
This branch has not been deployed
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.
Adds
lox statsto read the statistics the Miniserver logs, over the/stats/HTTP endpoints. Read-only.What it does
lox stats list(aliasls): lists every statistic file fromGET /stats/(name, group, month, uuid, label).--filter,--month,--latest(newest month per statistic).lox stats get <name|uuid>: fetches the monthlyGET /stats/<file>.xmlfiles and prints the values as table, CSV or JSON, one column per output (Outputs="total,totalNeg"→T,total,totalNeg).--group Nfor grouped statistics (meters),--from/--to YYYY-MM. Months are joined in order and the row that repeats at a month boundary is dropped.lox stats download --dir <dir>: mirrors the raw XML files locally, incrementally. A past month is skipped once the local copy was saved after that month ended; the current month is always refetched;--forcerefetches all. Files are written via.part+ rename. Honours the global--dry-run.Ambiguous names fail with
Ambiguous: '<name>' ...(→ambiguous_control) and list the candidates; unknown names usenot_found_errorwith suggestions.-o json,-o csvand--no-headerare honoured.Notes
/binstatisticdata/: they are self-describing (statistic name, group, output labels).quick-xml, file names are parsed by hand.RunContext.csv,dry_runandno_headerlose their#[allow(dead_code)], since stats reads them.docs/commands/inspection.mddescribed alox stats/lox historythat does not exist; that section now documents this command.cargo fmt --check,cargo clippy -- -D warnings,cargo build --releaseandcargo testpass.