pub fn new(metrics_registry: &MetricsRegistry) -> Self {
        Self {
            adverts_deleted_from_peer: metrics_registry.int_counter(
                "priority_adverts_deleted",
                "Number of adverts deleted from peer",
            ),
            priority_adverts_dropped: metrics_registry
                .int_counter("priority_adverts_dropped", "Number of adverts dropped"),
            priority_fn_updates: metrics_registry.int_counter(
                "priority_fn_updates",
                "Number of times priority function was updated",
            ),
            priority_fn_timer: metrics_registry.histogram(
                "priority_fn_time",
                "The time it took to update priorities with priority functions, in seconds",
                // 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0
                decimal_buckets(-1, 1),
            ),
            advert_queue_add: metrics_registry.int_counter_vec(
                "advert_queue_add",
                "Adverts added to the gossip advert map",
                &["peer", "priority"],
            ),
            advert_queue_remove: metrics_registry.int_counter_vec(
                "advert_queue_remove",
                "Adverts removed from the gossip advert map",
                &["peer", "priority"],
            ),
            advert_queue_size: metrics_registry.int_gauge_vec(
                "advert_queue_size",
                "Size of the gossip advert map",
                &["peer", "priority"],
            ),
        }
    }
/// The constructor returns a `DownloadPrioritizerMetrics` instance.
The constructor returns a `DownloadPrioritizerMetrics` instance.
The constructor returns a ` DownloadPrioritizerMetrics ` instance .
pub fn new(metrics_registry: &MetricsRegistry) -> Self {
        Self {
            adverts_deleted_from_peer: metrics_registry.int_counter(
                "priority_adverts_deleted",
                "Number of adverts deleted from peer",
            ),
            priority_adverts_dropped: metrics_registry
                .int_counter("priority_adverts_dropped", "Number of adverts dropped"),
            priority_fn_updates: metrics_registry.int_counter(
                "priority_fn_updates",
                "Number of times priority function was updated",
            ),
            priority_fn_timer: metrics_registry.histogram(
                "priority_fn_time",
                "The time it took to update priorities with priority functions, in seconds",
                // 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0
                decimal_buckets(-1, 1),
            ),
            advert_queue_add: metrics_registry.int_counter_vec(
                "advert_queue_add",
                "Adverts added to the gossip advert map",
                &["peer", "priority"],
            ),
            advert_queue_remove: metrics_registry.int_counter_vec(
                "advert_queue_remove",
                "Adverts removed from the gossip advert map",
                &["peer", "priority"],
            ),
            advert_queue_size: metrics_registry.int_gauge_vec(
                "advert_queue_size",
                "Size of the gossip advert map",
                &["peer", "priority"],
            ),
        }
    }
pub fn new ( metrics_registry : & MetricsRegistry ) -> Self { Self { adverts_deleted_from_peer : metrics_registry . int_counter ( " " , " " , ) , priority_adverts_dropped : metrics_registry . int_counter ( " " , " " ) , priority_fn_updates : metrics_registry . int_counter ( " " , " " , ) , priority_fn_timer : metrics_registry . histogram ( " " , " " , // 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0 decimal_buckets ( - 1 , 1 ) , ) , advert_queue_add : metrics_registry . int_counter_vec ( " " , " " , & [ " " , " " ] , ) , advert_queue_remove : metrics_registry . int_counter_vec ( " " , " " , & [ " " , " " ] , ) , advert_queue_size : metrics_registry . int_gauge_vec ( " " , " " , & [ " " , " " ] , ) , } }
The constructor returns a `DownloadPrioritizerMetrics` instance.
The constructor returns a ` DownloadPrioritizerMetrics ` instance .
metrics_registry
&MetricsRegistry
metrics_registry
&MetricsRegistry