Files
nym/nym-node/src/node/http/state/mod.rs
T
Jędrzej Stuczyński 3efeededc5 feature: expand nym-node prometheus metrics (#5298)
* fixed bearer auth for prometheus route

* basic prometheus metrics

* added rates on global values

* improved structure on the prometheus metrics

* added additional metrics for ingress websockets and egress mixnet connections

* some channel business metrics

* fixed metrics registration and added additional variants

* added counter for number of disk persisted packets

* counter for pending egress packets

* counter for pending egress forward packets

* clippy
2025-01-07 13:34:18 +00:00

31 lines
805 B
Rust

// Copyright 2023-2024 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
use crate::node::http::state::metrics::MetricsAppState;
use nym_node_metrics::NymNodeMetrics;
use nym_verloc::measurements::SharedVerlocStats;
use tokio::time::Instant;
pub mod metrics;
#[derive(Clone)]
pub struct AppState {
pub(crate) startup_time: Instant,
pub(crate) metrics: MetricsAppState,
}
impl AppState {
#[allow(clippy::new_without_default)]
pub fn new(metrics: NymNodeMetrics, verloc: SharedVerlocStats) -> Self {
AppState {
// is it 100% accurate?
// no.
// does it have to be?
// also no.
startup_time: Instant::now(),
metrics: MetricsAppState { metrics, verloc },
}
}
}