Skip to content

[VL] Metrics: Include kPreloadSplitPrepareTimeNanos in kDataSourceAddSplitWallNanos#11709

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

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

Conversation

@zhztheplayer
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@zhztheplayer can you fix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@FelixYBW

The code you suggested is exactly the same with the current code, I'm holding this off until getting more time to test this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, remove the prepare time:

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, current upstream is correct. We needn't the PR.

@rui-mo
Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

Waiting for @FelixYBW to confirm the background.

@FelixYBW
Copy link
Copy Markdown
Contributor

FelixYBW commented Mar 7, 2026

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

@zhztheplayer zhztheplayer marked this pull request as draft March 16, 2026 09:58
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the stale stale label May 7, 2026
@FelixYBW
Copy link
Copy Markdown
Contributor

FelixYBW commented May 7, 2026

needn't fix

@FelixYBW FelixYBW closed this May 7, 2026
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