[#13797] Align query range with TimeWindow interval - #13798
Conversation
6d85805 to
932249a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #13798 +/- ##
============================================
+ Coverage 33.19% 33.27% +0.08%
- Complexity 11542 11612 +70
============================================
Files 4153 4157 +4
Lines 97992 98153 +161
Branches 10390 10435 +45
============================================
+ Hits 32529 32664 +135
- Misses 62650 62671 +21
- Partials 2813 2818 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR standardizes time-range handling across the codebase to align queries and time-window computations with TimeWindow slot intervals by treating the end of a range as exclusive (i.e., [from, to)), and updates affected tests and query mappers accordingly.
Changes:
- Updated
TimeWindowwindow counting to remove inclusive-end behavior and adjusted unit tests to match exclusive-end semantics. - Replaced
BETWEEN ... AND ...with>= from AND < toacross multiple MyBatis XML mappers (Pinot and uristat/batch/exceptiontrace/inspector). - Updated various web-layer tests and controller query parameters to use refined
TimeWindowranges.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/test/java/com/navercorp/pinpoint/web/vo/stat/chart/ChartGroupBuilderTest.java | Adjusts test window range to match exclusive-end time window behavior. |
| web/src/test/java/com/navercorp/pinpoint/web/heatmap/util/TimeSeriesBuilderTest.java | Updates expected heatmap column counts/timestamps under exclusive-end semantics. |
| web/src/test/java/com/navercorp/pinpoint/web/applicationmap/view/ApdexScoreSlotViewBuilderTest.java | Updates expected slot count to reflect exclusive end. |
| web/src/test/java/com/navercorp/pinpoint/web/applicationmap/histogram/AgentTimeHistogramTest.java | Replaces hardcoded minute millis and adjusts ranges for updated windowing expectations. |
| web/src/main/resources/heatmap/web/mapper/pinot/HeatmapWebMapper.xml | Switches to >= from AND < to for refined/exclusive range querying. |
| web/src/main/java/com/navercorp/pinpoint/web/applicationmap/dao/hbase/MapScanFactory.java | Adjusts HBase scan key boundaries for revised range semantics. |
| uristat/uristat-web/src/main/resources/mapper/uristat/UriStatSummaryMapper.xml | Switches to >= from AND < to for summary queries. |
| uristat/uristat-web/src/main/resources/mapper/uristat/UriStatChartMapper.xml | Switches to >= from AND < to for chart queries. |
| uristat/uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/controller/UriStatController.java | Uses TimeWindow.getWindowRange() for query range consistency. |
| uristat/uristat-batch/src/main/resources/mapper/uristat/UriStatMapper.xml | Switches batch queries to >= from AND < to. |
| otlpmetric/otlpmetric-web/src/main/resources/otlpmetric/web/mapper/pinot/OtlpMetricMapper.xml | Switches Pinot metric queries to >= from AND < to. |
| metric-module/metric/src/main/resources/pinot-web/mapper/pinot/SystemMetricDoubleMapper.xml | Switches Pinot system metric query to >= from AND < to. |
| inspector-module/inspector-web/src/main/resources/inspector/web/mapper/pinot/applicationInspectorMapper.xml | Switches Pinot inspector queries to >= from AND < to. |
| inspector-module/inspector-web/src/main/resources/inspector/web/mapper/pinot/agentInspectorMapper.xml | Switches Pinot inspector queries to >= from AND < to. |
| exceptiontrace/exceptiontrace-web/src/main/resources/exceptiontrace/mapper/ExceptionMetadataMapper.xml | Switches exception metadata queries to >= from AND < to. |
| exceptiontrace/exceptiontrace-web/src/main/resources/exceptiontrace/mapper/ExceptionGroupMapper.xml | Switches exception group queries to >= from AND < to. |
| commons-timeseries/src/test/java/com/navercorp/pinpoint/common/timeseries/window/TimeWindowTest.java | Updates expectations for exclusive-end TimeWindow sizing and windows. |
| commons-timeseries/src/main/java/com/navercorp/pinpoint/common/timeseries/window/TimeWindow.java | Changes window count calculation consistent with exclusive-end semantics. |
| batch/src/main/resources/mapper/batch/BatchAlarmForPinotMapper.xml | Switches batch Pinot queries to >= from AND < to. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // start key is replaced by end key because timestamp has been reversed | ||
| byte[] startKey = mapScanKeyFactory.scanKey(serviceUid, application, range.getTo()); | ||
| byte[] endKey = mapScanKeyFactory.scanKey(serviceUid, application, range.getFrom()); | ||
| byte[] startKey = mapScanKeyFactory.scanKey(serviceUid, application, range.getTo() - 1); | ||
| byte[] endKey = mapScanKeyFactory.scanKey(serviceUid, application, range.getFrom() -1); |
| private long refineTimestampWithCeil(long timestamp) { | ||
| return refineTimestamp(timestamp + windowSlotSize - 1); | ||
| } |
| import java.time.Duration; | ||
| import java.time.temporal.ChronoUnit; |
|



No description provided.