Skip to content

[GLUTEN-8063][VL] Export cpuNanos metric for InputIteratorTransformer#11724

Open
n0r0shi wants to merge 1 commit intoapache:mainfrom
n0r0shi:feat/input-iterator-cpu-nanos
Open

[GLUTEN-8063][VL] Export cpuNanos metric for InputIteratorTransformer#11724
n0r0shi wants to merge 1 commit intoapache:mainfrom
n0r0shi:feat/input-iterator-cpu-nanos

Conversation

@n0r0shi
Copy link

@n0r0shi n0r0shi commented Mar 9, 2026

Summary

Surfaces Velox's cpuWallTiming.cpuNanos as a separate Spark SQL metric (cpu time) on InputIteratorTransformer. Currently only wallNanos and cpuCount are exposed — cpuNanos is available from Velox but not propagated to Gluten. This change threads it through: C++ → JNI → Java → Scala SQLMetric. The metric automatically appears in Spark UI and event logs.

Motivation

Related to #10618. InputIteratorTransformer sits at the boundary between Spark (shuffle/broadcast) and Velox. Its wall time includes I/O waits, not just CPU work. Exposing cpuNanos separately lets users distinguish compute-bound vs I/O-bound bottlenecks. For most other operators, cpuNanos ≈ wallNanos — this boundary operator is where they diverge the most.

Velox already tracks cpuNanos on every operator — exposing it as-is is the simplest approach and better than not surfacing CPU time at all.

Open questions

  • Any concerns with the metric name / label (cpu time)?
  • Should any other operators also expose cpuNanos? (e.g., operators that spill to disk)

Tests will be added once the approach is confirmed.

Related issue: #8063

Export Velox's cpuWallTiming.cpuNanos through the full metrics pipeline
(C++ -> JNI -> Java -> Scala) and display it as a new metric on
InputIteratorTransformer.

This addresses the confusing high wall time reported in apache#8063 and apache#10618
by providing a breakdown: wallNanos shows time including while
waiting for upstream dat), while cpuNanos shows the exclusive CPU time
(actual work done by the operator itself).
@github-actions github-actions bot added the VELOX label Mar 9, 2026
@n0r0shi n0r0shi marked this pull request as ready for review March 9, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant