Package org.apache.datafusion
Class RuntimeStats
java.lang.Object
org.apache.datafusion.RuntimeStats
Snapshot of the underlying Tokio runtime from
SessionContext.runtimeStats(). Mirrors the
subset of tokio_metrics::RuntimeMetrics fields that node-level dashboards typically
surface (worker count, busy time, queue depth, etc.).
Instances are immutable. The snapshot is process-wide rather than per-session because the JNI
library drives a single shared multi-threaded Tokio runtime; gating on the SessionContext
only ensures the caller still has a live handle.
Requires the runtime-metrics Cargo feature on the native crate, plus
RUSTFLAGS="--cfg tokio_unstable" at build time.
-
Constructor Summary
ConstructorsConstructorDescriptionRuntimeStats(int numWorkers, long liveTasksCount, long globalQueueDepth, long elapsedNanos, long totalBusyNanos, long totalParkCount, long totalPollsCount, long totalNoopCount, long totalStealCount, long totalLocalScheduleCount, long totalOverflowCount) -
Method Summary
Modifier and TypeMethodDescriptionlongWall-clock nanoseconds covered by this snapshot's interval (since runtime start).longTasks waiting in the global injection queue, not yet picked up by a worker.longNumber of tasks currently scheduled (alive) on the runtime.intNumber of OS worker threads driving the multi-threaded Tokio runtime.toString()longTotal nanoseconds workers spent doing work (sum across workers).longTasks scheduled into a worker's local queue.longTimes a worker unparked but found no work (false wakeup).longTimes a worker's local queue overflowed and pushed tasks to the injector.longTimes a worker has parked itself (gone idle waiting for work).longTotal task polls completed across workers.longTimes a worker successfully stole tasks from another worker.
-
Constructor Details
-
RuntimeStats
public RuntimeStats(int numWorkers, long liveTasksCount, long globalQueueDepth, long elapsedNanos, long totalBusyNanos, long totalParkCount, long totalPollsCount, long totalNoopCount, long totalStealCount, long totalLocalScheduleCount, long totalOverflowCount)
-
-
Method Details
-
numWorkers
public int numWorkers()Number of OS worker threads driving the multi-threaded Tokio runtime. -
liveTasksCount
public long liveTasksCount()Number of tasks currently scheduled (alive) on the runtime. -
globalQueueDepth
public long globalQueueDepth()Tasks waiting in the global injection queue, not yet picked up by a worker. -
elapsedNanos
public long elapsedNanos()Wall-clock nanoseconds covered by this snapshot's interval (since runtime start). -
totalBusyNanos
public long totalBusyNanos()Total nanoseconds workers spent doing work (sum across workers). -
totalParkCount
public long totalParkCount()Times a worker has parked itself (gone idle waiting for work). -
totalPollsCount
public long totalPollsCount()Total task polls completed across workers. -
totalNoopCount
public long totalNoopCount()Times a worker unparked but found no work (false wakeup). -
totalStealCount
public long totalStealCount()Times a worker successfully stole tasks from another worker. -
totalLocalScheduleCount
public long totalLocalScheduleCount()Tasks scheduled into a worker's local queue. -
totalOverflowCount
public long totalOverflowCount()Times a worker's local queue overflowed and pushed tasks to the injector. -
toString
-