mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
27 lines
594 B
Rust
27 lines
594 B
Rust
//! Task Executor Metrics
|
|
use reth_metrics::{
|
|
metrics::{self, Counter},
|
|
Metrics,
|
|
};
|
|
|
|
/// Task Executor Metrics
|
|
#[derive(Metrics, Clone)]
|
|
#[metrics(scope = "executor.spawn")]
|
|
pub struct TaskExecutorMetrics {
|
|
/// Number of spawned critical tasks
|
|
pub(crate) critical_tasks: Counter,
|
|
|
|
/// Number of spawned regular tasks
|
|
pub(crate) regular_tasks: Counter,
|
|
}
|
|
|
|
impl TaskExecutorMetrics {
|
|
pub(crate) fn inc_critical_tasks(&self) {
|
|
self.critical_tasks.increment(1);
|
|
}
|
|
|
|
pub(crate) fn inc_regular_task(&self) {
|
|
self.regular_tasks.increment(1);
|
|
}
|
|
}
|