Package com.linkedin.venice.stats
Class ThreadPoolStats
java.lang.Object
com.linkedin.venice.stats.AbstractVeniceStats
com.linkedin.venice.stats.ThreadPoolStats
- Direct Known Subclasses:
ParticipantStateTransitionStats
Stats used to collect the usage of a thread pool including: 1. active thread number, 2. max thread number and 3.
queued task number.
-
Field Summary
Fields inherited from class com.linkedin.venice.stats.AbstractVeniceStats
DELIMITER -
Constructor Summary
ConstructorsConstructorDescriptionThreadPoolStats(io.tehuti.metrics.MetricsRepository metricsRepository, ThreadPoolExecutor threadPoolExecutor, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidSamples active threads on request arrival when OTel is enabled to capture avg/max usage between metric collections.voidRecords the current queue size as a distribution data point for the task distribution metric.Methods inherited from class com.linkedin.venice.stats.AbstractVeniceStats
avgAndMax, avgAndTotal, getMetricFullName, getMetricsRepository, getName, getSensorFullName, getSensorFullName, isTotalStats, minAndMax, registerOnlyTotalRate, registerOnlyTotalSensor, registerPerStoreAndTotal, registerPerStoreAndTotalSensor, registerSensor, registerSensor, registerSensor, registerSensor, registerSensorAttributeGauge, registerSensorIfAbsent, registerSensorIfAbsent, registerSensorIfAbsent, registerSensorWithAggregate, registerSensorWithAggregate, unregisterAllSensors
-
Constructor Details
-
ThreadPoolStats
public ThreadPoolStats(io.tehuti.metrics.MetricsRepository metricsRepository, ThreadPoolExecutor threadPoolExecutor, String name)
-
-
Method Details
-
recordQueuedTasksCount
public void recordQueuedTasksCount()Records the current queue size as a distribution data point for the task distribution metric. Callers should invoke this on each task submission to capture avg/max queue depth within the metric reporting window. -
recordActiveThreadsCount
public void recordActiveThreadsCount()Samples active threads on request arrival when OTel is enabled to capture avg/max usage between metric collections. The executor's active count is approximate and request-triggered samples may miss peaks.
-