Trim metrics summary reports to user-specified time range #573
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.
This pull request introduces a new feature for trimming metrics to a specific time range and refactors the metrics codebase to use integer timestamps consistently. It also improves usability and robustness in the metrics reporting and summary generation. The most important changes are grouped below:
New Feature: Time Range Trimming for Metrics
metrics trimsubcommand, allowing users to generate summary reports for a specific time interval using either absolute timestamps or relative offsets. This is documented in theREADME.mdwith usage examples and output details.filterByTimeRangemethods for bothMetricCollectionandMetricGroup, enabling filtering of metrics rows to a specified time range. The summary generation pipeline now supports time-based trimming viasummarizeMetricsWithTrim. [1] [2]Timestamp Refactor
float64tointthroughout the metrics codebase, including struct fields, parsing logic, aggregation, and tests, ensuring consistency and simplifying time-based operations. [1] [2] [3] [4] [5] [6]Usability Improvements
Robustness and Error Handling
Initializedmethod to theMetadatastruct and updated the JSON marshaling logic to outputnullif metadata is uninitialized, preventing errors in downstream report generation.Frontend/Reporting Enhancements
system_infoormetadatamay be undefined, preventing runtime errors in the interactive report. [1] [2]