/// Create new metrics that are linked to the given registry and carry the given attributes.
Create new metrics that are linked to the given registry and carry the given attributes.
Create new metrics that are linked to the given registry and carry the given attributes .
pub fn new(registry: &metric::Registry, attributes: impl Into<Attributes>) -> Self {
        let attributes: Attributes = attributes.into();
        let permits_acquired = registry
            .register_metric::<U64Gauge>(
                "iox_async_semaphore_permits_acquired",
                "Number of currently acquired permits",
            )
            .recorder(attributes.clone());
        let permits_total = registry
            .register_metric::<U64Gauge>(
                "iox_async_semaphore_permits_total",
                "Number of total permits",
            )
            .recorder(attributes.clone());
        let permits_pending = registry
            .register_metric::<U64Gauge>(
                "iox_async_semaphore_permits_pending",
                "Number of pending permits",
            )
            .recorder(attributes.clone());
        let holders_acquired = registry
            .register_metric::<U64Gauge>(
                "iox_async_semaphore_holders_acquired",
                "Number of currently acquired semaphore holders. Each holder might have multiple permits",
            )
            .recorder(attributes.clone());
        let holders_pending = registry
            .register_metric::<U64Gauge>(
                "iox_async_semaphore_holders_pending",
                "Number of pending semaphore holders. Each holder might have multiple permits",
            )
            .recorder(attributes.clone());
        let acquire_duration = registry
            .register_metric::<DurationHistogram>(
                "iox_async_semaphore_acquire_duration",
                "Duration it takes to acquire a semaphore",
            )
            .recorder(attributes);
        Self {
            permits_acquired,
            permits_total,
            permits_pending,
            holders_acquired,
            holders_pending,
            acquire_duration,
        }
    }
pub fn new ( registry : & metric :: Registry , attributes : impl Into < Attributes > ) -> Self { let attributes : Attributes = attributes . into ( ) ; let permits_acquired = registry . register_metric :: < U64Gauge > ( " " , " " , ) . recorder ( attributes . clone ( ) ) ; let permits_total = registry . register_metric :: < U64Gauge > ( " " , " " , ) . recorder ( attributes . clone ( ) ) ; let permits_pending = registry . register_metric :: < U64Gauge > ( " " , " " , ) . recorder ( attributes . clone ( ) ) ; let holders_acquired = registry . register_metric :: < U64Gauge > ( " " , " " , ) . recorder ( attributes . clone ( ) ) ; let holders_pending = registry . register_metric :: < U64Gauge > ( " " , " " , ) . recorder ( attributes . clone ( ) ) ; let acquire_duration = registry . register_metric :: < DurationHistogram > ( " " , " " , ) . recorder ( attributes ) ; Self { permits_acquired , permits_total , permits_pending , holders_acquired , holders_pending , acquire_duration , } }
Create new metrics that are linked to the given registry and carry the given attributes.
Create new metrics that are linked to the given registry and carry the given attributes .
registry
&metric::Registry
attributes
impl Into<Attributes>