pub trait MonitoringRepository<DB: Database>: DatabaseRepository<DB> {
// Required methods
fn record_system_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 SystemMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_system_metrics_history<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SystemMetrics>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn record_application_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 ApplicationMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_application_metrics_history<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ApplicationMetrics>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn record_model_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 ModelMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_model_metrics_history<'life0, 'async_trait>(
&'life0 self,
model_id: Uuid,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelMetrics>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_alert_event<'life0, 'life1, 'async_trait>(
&'life0 self,
alert: &'life1 AlertEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_alert_event<'life0, 'life1, 'async_trait>(
&'life0 self,
alert: &'life1 AlertEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_active_alerts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AlertEvent>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_alert_history<'life0, 'async_trait>(
&'life0 self,
limit: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<AlertEvent>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
监控数据库仓库
Required Methods§
Sourcefn record_system_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 SystemMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_system_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 SystemMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
记录系统指标
Sourcefn get_system_metrics_history<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SystemMetrics>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_system_metrics_history<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SystemMetrics>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取系统指标历史
Sourcefn record_application_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 ApplicationMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_application_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 ApplicationMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
记录应用指标
Sourcefn get_application_metrics_history<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ApplicationMetrics>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_application_metrics_history<'life0, 'async_trait>(
&'life0 self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ApplicationMetrics>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取应用指标历史
Sourcefn record_model_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 ModelMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_model_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 ModelMetrics,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
记录模型指标
Sourcefn get_model_metrics_history<'life0, 'async_trait>(
&'life0 self,
model_id: Uuid,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelMetrics>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_model_metrics_history<'life0, 'async_trait>(
&'life0 self,
model_id: Uuid,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelMetrics>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取模型指标历史
Sourcefn create_alert_event<'life0, 'life1, 'async_trait>(
&'life0 self,
alert: &'life1 AlertEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_alert_event<'life0, 'life1, 'async_trait>(
&'life0 self,
alert: &'life1 AlertEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
创建告警事件
Sourcefn update_alert_event<'life0, 'life1, 'async_trait>(
&'life0 self,
alert: &'life1 AlertEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_alert_event<'life0, 'life1, 'async_trait>(
&'life0 self,
alert: &'life1 AlertEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
更新告警事件
Sourcefn get_active_alerts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AlertEvent>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_active_alerts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AlertEvent>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取活跃告警