Class RuntimeStats

java.lang.Object
org.apache.datafusion.RuntimeStats

public final class RuntimeStats extends Object
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

    Constructors
    Constructor
    Description
    RuntimeStats(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 Type
    Method
    Description
    long
    Wall-clock nanoseconds covered by this snapshot's interval (since runtime start).
    long
    Tasks waiting in the global injection queue, not yet picked up by a worker.
    long
    Number of tasks currently scheduled (alive) on the runtime.
    int
    Number of OS worker threads driving the multi-threaded Tokio runtime.
     
    long
    Total nanoseconds workers spent doing work (sum across workers).
    long
    Tasks scheduled into a worker's local queue.
    long
    Times a worker unparked but found no work (false wakeup).
    long
    Times a worker's local queue overflowed and pushed tasks to the injector.
    long
    Times a worker has parked itself (gone idle waiting for work).
    long
    Total task polls completed across workers.
    long
    Times a worker successfully stole tasks from another worker.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public String toString()
      Overrides:
      toString in class Object