use async_graphql::Object;
use crate::{
api::schema::metrics::{self, MetricsFilter},
event::Metric,
};
#[derive(Debug, Clone)]
pub struct GenericSinkMetrics(Vec<Metric>);
impl GenericSinkMetrics {
pub const fn new(metrics: Vec<Metric>) -> Self {
Self(metrics)
}
}
#[Object]
impl GenericSinkMetrics {
pub async fn received_events_total(&self) -> Option<metrics::ReceivedEventsTotal> {
self.0.received_events_total()
}
pub async fn sent_bytes_total(&self) -> Option<metrics::SentBytesTotal> {
self.0.sent_bytes_total()
}
pub async fn sent_events_total(&self) -> Option<metrics::SentEventsTotal> {
self.0.sent_events_total()
}
}