feat: Add specific timeframe support with --start-time and --end-time#499
feat: Add specific timeframe support with --start-time and --end-time#499
Conversation
…eframe support Adds optional start_time and end_time datetime fields to the Settings class. When provided, these take precedence over history_duration for calculating the metrics query time range. Closes #474
Update get_query_time_range() to check for start_time/end_time settings. When both are provided, use them directly instead of calculating from history_duration relative to current time.
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request introduces a comprehensive refactoring of the strategy and configuration layers. It replaces tightly-scoped models with generic public entities in the strategy system, adds new data models (K8sObjectData, HPAData, HistoryData), and restructures the configuration from a monolithic Config class into modular, composable settings objects with ISO8601 datetime parsing support. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR adds support for specifying absolute time ranges for KRR metrics queries, addressing the feature request in #474.
Changes
1.
robusta_krr/core/models/config.pystart_timeandend_timeoptional datetime fields to theSettingsclassZsuffix and timezone offsets)2.
robusta_krr/core/abstract/strategies.pyget_query_time_range()method inBaseStrategyto check forstart_timeandend_timehistory_duration(relative timeframe mode)Usage
Users can now specify a specific time range in two ways:
Via Configuration File
Programmatically
Why This Feature?
As described in #474, users need to analyze specific historical time periods (like past peak events) without querying all data from that time until now. This is especially useful for:
Testing
Related Issues
Closes #474