Repository navigation
Improve --latest option (legacy) - #49
pjcdawkins wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the legacy metrics commands’ --latest behavior to use a 5-minute “grain” by default (and a 5-minute range when no explicit range/interval is provided), aligning the CLI output with the metrics API’s aggregation window expectations.
Changes:
- Added
LATEST_GRAIN(300s) and documentedDEFAULT_RANGEas 10 minutes. - Updated
--latestoption help text to mention the 5-minute aggregation window and how to override it. - Adjusted time validation so
--latestdefaults to a 5-minute range and grain when--intervalis not provided.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Detect whether `--interval` was provided using a strict null/empty-string check rather than truthiness, so a literal `0` (or any duration that parses to zero seconds) is rejected with a clear error instead of being silently replaced with the default range/grain. Also corrects a stale "Invalid --range" message in the --interval validation branch. Addresses Copilot review feedback on #49. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Closing in favor of #165, which takes a different approach. The 5-minute grain doesn't fully fix #45: the API aligns 5-minute buckets to clock boundaries and returns the in-progress bucket, which is missing containers for about a minute after each boundary (the same gap as 1-minute points). #165 keeps the default grain and has Thanks @mharacewiat for the original change. 🤖 Generated with Claude Code |
Migrated from platformsh/legacy-cli#1596 (original author: @mharacewiat).
Adds a
LATEST_GRAINconstant (300s) used as the default range and interval when--latestis given without an explicit--interval, and updates the option help to mention the 5-minute aggregation window. The 5.x DI/public conststyle was preserved when re-applying the patch.Closes #45