#[cfg(feature = "cloudwatch")]
pub mod cw;
use std::{io, sync::Arc};
use avalanche_types::metrics::avalanchego::RawMetrics;
use chrono::Utc;
use log::info;
pub async fn get(url: Arc<String>) -> io::Result<RawMetrics> {
let ts = Utc::now();
let joined = http_manager::join_uri(url.as_str(), "ext/metrics")?;
info!("checking for {:?}", joined);
let rb = http_manager::get_non_tls(url.as_str(), "ext/metrics").await?;
let s = prometheus_manager::Scrape::from_bytes(&rb)?;
Ok(RawMetrics {
ts,
avalanche_network_peers: Some(
prometheus_manager::match_metric(&s.metrics, |s| s.metric == "avalanche_network_peers")
.value
.to_f64(),
),
avalanche_network_pull_query_sent: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_pull_query_sent"
})
.value
.to_f64(),
),
avalanche_network_push_query_sent: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_push_query_sent"
})
.value
.to_f64(),
),
avalanche_network_msgs_failed_to_parse: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_msgs_failed_to_parse"
})
.value
.to_f64(),
),
avalanche_network_inbound_conn_throttler_allowed: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_inbound_conn_throttler_allowed"
})
.value
.to_f64(),
),
avalanche_network_byte_throttler_inbound_awaiting_release: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_byte_throttler_inbound_awaiting_release"
})
.value
.to_f64(),
),
avalanche_network_throttler_outbound_acquire_failures: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_throttler_outbound_acquire_failures"
})
.value
.to_f64(),
),
avalanche_network_throttler_outbound_awaiting_release: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_throttler_outbound_awaiting_release"
})
.value
.to_f64(),
),
avalanche_requests_average_latency: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_requests_average_latency"
})
.value
.to_f64(),
),
avalanche_network_version_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_version_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_version_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_version_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_peerlist_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_peerlist_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_peerlist_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_peerlist_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_ping_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_ping_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_ping_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_ping_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_pong_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_pong_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_pong_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_pong_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_chits_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_chits_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_chits_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_chits_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_put_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_put_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_put_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_put_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_pull_query_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_pull_query_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_pull_query_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_pull_query_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_push_query_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_push_query_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_push_query_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_push_query_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_accepted_frontier_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_accepted_frontier_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_accepted_frontier_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_accepted_frontier_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_accepted_frontier_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_accepted_frontier_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_accepted_frontier_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_accepted_frontier_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_accepted_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_accepted_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_accepted_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_accepted_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_accepted_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_accepted_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_accepted_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_accepted_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_ancestors_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_ancestors_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_get_ancestors_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_get_ancestors_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_ancestors_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_ancestors_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_ancestors_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_ancestors_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_app_gossip_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_app_gossip_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_app_gossip_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_app_gossip_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_app_request_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_app_request_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_app_request_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_app_request_received_bytes"
})
.value
.to_f64(),
),
avalanche_network_app_response_sent_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_app_response_sent_bytes"
})
.value
.to_f64(),
),
avalanche_network_app_response_received_bytes: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_network_app_response_received_bytes"
})
.value
.to_f64(),
),
avalanche_x_db_get_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_db_get_count"
})
.value
.to_f64(),
),
avalanche_x_db_write_size_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_db_write_size_sum"
})
.value
.to_f64(),
),
avalanche_x_db_read_size_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_db_read_size_sum"
})
.value
.to_f64(),
),
avalanche_x_vtx_processing: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_vtx_processing"
})
.value
.to_f64(),
),
avalanche_x_txs_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_txs_accepted_count"
})
.value
.to_f64(),
),
avalanche_x_txs_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_txs_accepted_sum"
})
.value
.to_f64(),
),
avalanche_x_txs_rejected_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_txs_rejected_count"
})
.value
.to_f64(),
),
avalanche_x_txs_rejected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_txs_rejected_sum"
})
.value
.to_f64(),
),
avalanche_x_txs_polls_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_txs_polls_accepted_count"
})
.value
.to_f64(),
),
avalanche_x_txs_polls_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_txs_polls_accepted_sum"
})
.value
.to_f64(),
),
avalanche_x_polls_successful: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_polls_successful"
})
.value
.to_f64(),
),
avalanche_x_polls_failed: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_polls_failed"
})
.value
.to_f64(),
),
avalanche_x_handler_chits_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_handler_chits_count"
})
.value
.to_f64(),
),
avalanche_x_handler_query_failed_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_handler_query_failed_count"
})
.value
.to_f64(),
),
avalanche_x_rogue_tx_issued: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_rogue_tx_issued"
})
.value
.to_f64(),
),
avalanche_x_virtuous_tx_issued: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_virtuous_tx_issued"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_accepted_count"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_accepted_sum"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_polls_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_polls_accepted_count"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_polls_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_polls_accepted_sum"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_polls_rejected_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_polls_rejected_count"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_polls_rejected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_polls_rejected_sum"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_processing: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_processing"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_rejected_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_rejected_count"
})
.value
.to_f64(),
),
avalanche_x_whitelist_tx_rejected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_tx_rejected_sum"
})
.value
.to_f64(),
),
avalanche_x_whitelist_vtx_issue_failure: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_vtx_issue_failure"
})
.value
.to_f64(),
),
avalanche_x_whitelist_vtx_issue_success: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_whitelist_vtx_issue_success"
})
.value
.to_f64(),
),
avalanche_x_benchlist_benched_num: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_X_benchlist_benched_num"
})
.value
.to_f64(),
),
avalanche_p_vm_total_staked: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_vm_total_staked"
})
.value
.to_f64(),
),
avalanche_p_db_get_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_db_get_count"
})
.value
.to_f64(),
),
avalanche_p_db_write_size_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_db_write_size_sum"
})
.value
.to_f64(),
),
avalanche_p_db_read_size_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_db_read_size_sum"
})
.value
.to_f64(),
),
avalanche_p_blks_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_blks_accepted_count"
})
.value
.to_f64(),
),
avalanche_p_blks_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_blks_accepted_sum"
})
.value
.to_f64(),
),
avalanche_p_blks_rejected_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_blks_rejected_count"
})
.value
.to_f64(),
),
avalanche_p_blks_rejected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_blks_rejected_sum"
})
.value
.to_f64(),
),
avalanche_p_polls_successful: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_polls_successful"
})
.value
.to_f64(),
),
avalanche_p_polls_failed: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_polls_failed"
})
.value
.to_f64(),
),
avalanche_p_blks_polls_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_blks_polls_accepted_count"
})
.value
.to_f64(),
),
avalanche_p_blks_polls_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_blks_polls_accepted_sum"
})
.value
.to_f64(),
),
avalanche_p_handler_chits_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_handler_chits_count"
})
.value
.to_f64(),
),
avalanche_p_handler_query_failed_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_handler_query_failed_count"
})
.value
.to_f64(),
),
avalanche_p_benchlist_benched_num: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_P_benchlist_benched_num"
})
.value
.to_f64(),
),
avalanche_c_db_get_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_db_get_count"
})
.value
.to_f64(),
),
avalanche_c_db_write_size_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_db_write_size_sum"
})
.value
.to_f64(),
),
avalanche_c_db_read_size_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_db_read_size_sum"
})
.value
.to_f64(),
),
avalanche_c_blks_processing: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_processing"
})
.value
.to_f64(),
),
avalanche_c_blks_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_accepted_count"
})
.value
.to_f64(),
),
avalanche_c_blks_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_accepted_sum"
})
.value
.to_f64(),
),
avalanche_c_blks_rejected_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_rejected_count"
})
.value
.to_f64(),
),
avalanche_c_blks_rejected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_rejected_sum"
})
.value
.to_f64(),
),
avalanche_c_blks_polls_accepted_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_polls_accepted_count"
})
.value
.to_f64(),
),
avalanche_c_blks_polls_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_blks_polls_accepted_sum"
})
.value
.to_f64(),
),
avalanche_c_polls_successful: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_polls_successful"
})
.value
.to_f64(),
),
avalanche_c_polls_failed: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_polls_failed"
})
.value
.to_f64(),
),
avalanche_c_handler_chits_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_chits_count"
})
.value
.to_f64(),
),
avalanche_c_handler_query_failed_count: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_query_failed_count"
})
.value
.to_f64(),
),
avalanche_c_handler_get_accepted_frontier_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_accepted_frontier_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_app_gossip_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_app_gossip_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_app_request_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_app_request_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_app_request_failed_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_app_request_failed_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_app_response_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_app_response_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_accepted_frontier_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_accepted_frontier_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_accepted_frontier_failed_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_accepted_frontier_failed_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_accepted_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_accepted_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_accepted_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_accepted_failed_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_accepted_failed_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_ancestors_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_ancestors_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_ancestors_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_ancestors_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_ancestors_failed_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_ancestors_failed_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_put_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_put_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_get_failed_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_get_failed_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_push_query_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_push_query_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_pull_query_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_pull_query_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_chits_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_chits_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_query_failed_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_query_failed_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_connected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_connected_sum"
})
.value
.to_f64(),
),
avalanche_c_handler_disconnected_sum: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_handler_disconnected_sum"
})
.value
.to_f64(),
),
avalanche_c_benchlist_benched_num: Some(
prometheus_manager::match_metric(&s.metrics, |s| {
s.metric == "avalanche_C_benchlist_benched_num"
})
.value
.to_f64(),
),
})
}
pub async fn spawn_get(u: &str) -> io::Result<RawMetrics> {
let ep_arc = Arc::new(u.to_string());
tokio::spawn(async move { get(ep_arc).await })
.await
.expect("failed spawn await")
}