Skip to content

[timeseries] Adding timeUsedMs to query statistics#17676

Open
shauryachats wants to merge 3 commits intoapache:masterfrom
shauryachats:ts_timeused
Open

[timeseries] Adding timeUsedMs to query statistics#17676
shauryachats wants to merge 3 commits intoapache:masterfrom
shauryachats:ts_timeused

Conversation

@shauryachats
Copy link
Collaborator

@shauryachats shauryachats commented Feb 11, 2026

Summary

The end to end time used for TSE query cannot be directly derived from the underlying v1 query execution, and hence this PR adds that to the query statistics. Also adds a bunch of other statistics.

Testing

Successfully added an integration test assertion for timeUsedMs and verified that timeUseMs is being populated in Quickstart UI.
Screenshot 2026-02-12 at 12 17 40 PM

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 23.33333% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.19%. Comparing base (5be01ef) to head (53491a7).
⚠️ Report is 17 commits behind head on master.

Files with missing lines Patch % Lines
...mmon/response/mapper/TimeSeriesResponseMapper.java 0.00% 11 Missing ⚠️
...roker/requesthandler/TimeSeriesRequestHandler.java 0.00% 6 Missing ⚠️
.../timeseries/TimeSeriesExchangeReceiveOperator.java 50.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17676      +/-   ##
============================================
- Coverage     63.25%   63.19%   -0.06%     
- Complexity     1499     1500       +1     
============================================
  Files          3174     3179       +5     
  Lines        190373   190723     +350     
  Branches      29089    29154      +65     
============================================
+ Hits         120417   120525     +108     
- Misses        60619    60829     +210     
- Partials       9337     9369      +32     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.16% <23.33%> (-0.06%) ⬇️
java-21 63.16% <23.33%> (-0.07%) ⬇️
temurin 63.19% <23.33%> (-0.06%) ⬇️
unittests 63.19% <23.33%> (-0.06%) ⬇️
unittests1 55.61% <29.16%> (-0.04%) ⬇️
unittests2 34.03% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shauryachats shauryachats added timeseries-engine Tracking tag for generic time-series engine work timeseries-general-availability Work for making Timeseries Engine GA in Pinot (e.g. Controller UI support, debuggability, etc.) labels Feb 12, 2026
timeSeriesBlock = _queryDispatcher.submitAndGet(requestContext.getRequestId(), dispatchablePlan,
timeSeriesRequest.getTimeout().toMillis(), requestContext);

long endToEndTimeMs = System.currentTimeMillis() - queryStartTime;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should return time for every case. There are some if conditions like on L161 which will miss this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved it to the finally block. The error cases would still have zero time used since we only throw exceptions.


for (DataTable.MetadataKey statKey : MIN_STATS_KEYS) {
String key = statKey.getName();
String existingValue = aggregatedStats.getOrDefault(key, "0");
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this mean that the result will always be 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Updated to Long.MAX_VALUE.

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

Labels

timeseries-engine Tracking tag for generic time-series engine work timeseries-general-availability Work for making Timeseries Engine GA in Pinot (e.g. Controller UI support, debuggability, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants