Skip to content

[VL] Metrics: Include kPreloadSplitPrepareTimeNanos in kDataSourceAddSplitWallNanos#11709

Open
zhztheplayer wants to merge 1 commit intoapache:mainfrom
zhztheplayer:wip-add-metric-splittime
Open

[VL] Metrics: Include kPreloadSplitPrepareTimeNanos in kDataSourceAddSplitWallNanos#11709
zhztheplayer wants to merge 1 commit intoapache:mainfrom
zhztheplayer:wip-add-metric-splittime

Conversation

@zhztheplayer
Copy link
Member

@zhztheplayer zhztheplayer commented Mar 5, 2026

Breaking change on UI: Metric data source add split time total on Spark UI will be shown longer than before.

Include missing preloadSplitPrepareTimeNanos from the 3 split-adding metrics.

before:
Screenshot 2026-03-05 at 15 15 42
after:
Screenshot 2026-03-05 at 15 15 53

runtimeMetric("sum", second->customStats, kDataSourceAddSplitWallNanos) +
runtimeMetric("sum", second->customStats, kWaitForPreloadSplitNanos);
runtimeMetric("sum", second->customStats, kWaitForPreloadSplitNanos) +
runtimeMetric("sum", second->customStats, kPreloadSplitPrepareTimeNanos);
Copy link
Contributor

Choose a reason for hiding this comment

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

I recall that kWaitForPreloadSplitNanos was intentionally excluded. cc: @FelixYBW Not sure if this might impact any metric comparisons in your script.

Copy link
Member Author

Choose a reason for hiding this comment

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

By the way, kWaitForPreloadSplitNanos includes the duration of bloom-filter initialization, it's costly in current Gluten version.

Copy link
Contributor

Choose a reason for hiding this comment

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

kDataSourceAddSplitWallNanos is used to breakdown the elapsed time of table scan. It should count the time waiting in main thread only.

kDataSourceAddSplitWallNanos count the time when there is no pending split in queue, we need to start a new split fetch.

kWaitForPreloadSplitNanos counts the time when a split is already prefetched but not returned yet.

kPreloadSplitPrepareTimeNanos counts the sum time of all outstanding prefetched splits time. It doesn't include the ondemand split fetch.

So here

      metrics_->get(Metrics::kDataSourceAddSplitWallNanos)[metricIndex] =
          runtimeMetric("sum", second->customStats, kDataSourceAddSplitWallNanos) +
          runtimeMetric("sum", second->customStats, kWaitForPreloadSplitNanos)

@rui-mo
Copy link
Contributor

rui-mo commented Mar 5, 2026

Could you highlight the backward compatibility for metrics can be affected in the PR description?

@zhztheplayer
Copy link
Member Author

@rui-mo I added a breaking change line in PR desc.

Waiting for @FelixYBW to confirm the background.

@FelixYBW
Copy link
Contributor

FelixYBW commented Mar 7, 2026

hold on the merge. velox changed some metrics there recently. I need to take a look

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants