Skip to content

[#13797] Align query range with TimeWindow interval - #13798

Draft
donghun-cho wants to merge 1 commit into
pinpoint-apm:masterfrom
donghun-cho:fixBoundary
Draft

[#13797] Align query range with TimeWindow interval#13798
donghun-cho wants to merge 1 commit into
pinpoint-apm:masterfrom
donghun-cho:fixBoundary

Conversation

@donghun-cho

Copy link
Copy Markdown
Contributor

No description provided.

@donghun-cho
donghun-cho force-pushed the fixBoundary branch 3 times, most recently from 6d85805 to 932249a Compare June 4, 2026 01:58
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.27%. Comparing base (3ec67af) to head (838650a).
⚠️ Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
...t/web/applicationmap/dao/hbase/MapScanFactory.java 0.00% 4 Missing ⚠️
.../pinpoint/common/timeseries/window/TimeWindow.java 50.00% 1 Missing ⚠️
...oint/uristat/web/controller/UriStatController.java 0.00% 1 Missing ⚠️
...va/com/navercorp/pinpoint/web/vo/RangeFactory.java 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TimeWindow window counting to remove inclusive-end behavior and adjusted unit tests to match exclusive-end semantics.
  • Replaced BETWEEN ... AND ... with >= from AND < to across multiple MyBatis XML mappers (Pinot and uristat/batch/exceptiontrace/inspector).
  • Updated various web-layer tests and controller query parameters to use refined TimeWindow ranges.

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.

Comment on lines +55 to +57
// 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);
Comment on lines +91 to +93
private long refineTimestampWithCeil(long timestamp) {
return refineTimestamp(timestamp + windowSlotSize - 1);
}
Comment on lines +41 to +42
import java.time.Duration;
import java.time.temporal.ChronoUnit;
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants