Trait CustomMetricSqlLogic

Source
pub trait CustomMetricSqlLogic {
    // Provided methods
    fn insert_custom_metric_values_batch<'life0, 'life1, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        records: &'life1 [CustomMetricServerRecord],
    ) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_custom_metric_values<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        service_info: &'life1 ServiceInfo,
        limit_datetime: &'life2 DateTime<Utc>,
        metrics: &'life3 [String],
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn get_records<'life0, 'life1, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        params: &'life1 DriftRequest,
        minutes: i32,
    ) -> Pin<Box<dyn Future<Output = Result<BinnedCustomMetrics, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn merge_feature_results(
        results: BinnedCustomMetrics,
        map: &mut BinnedCustomMetrics,
    ) -> Result<(), SqlError> { ... }
    fn get_archived_records<'life0, 'life1, 'async_trait>(
        params: &'life0 DriftRequest,
        begin: DateTime<Utc>,
        end: DateTime<Utc>,
        minutes: i32,
        storage_settings: &'life1 ObjectStorageSettings,
    ) -> Pin<Box<dyn Future<Output = Result<BinnedCustomMetrics, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_binned_custom_drift_records<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        params: &'life1 DriftRequest,
        retention_period: &'life2 i32,
        storage_settings: &'life3 ObjectStorageSettings,
    ) -> Pin<Box<dyn Future<Output = Result<BinnedCustomMetrics, SqlError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
}

Provided Methods§

Source

fn insert_custom_metric_values_batch<'life0, 'life1, 'async_trait>( pool: &'life0 Pool<Postgres>, records: &'life1 [CustomMetricServerRecord], ) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_custom_metric_values<'life0, 'life1, 'life2, 'life3, 'async_trait>( pool: &'life0 Pool<Postgres>, service_info: &'life1 ServiceInfo, limit_datetime: &'life2 DateTime<Utc>, metrics: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn get_records<'life0, 'life1, 'async_trait>( pool: &'life0 Pool<Postgres>, params: &'life1 DriftRequest, minutes: i32, ) -> Pin<Box<dyn Future<Output = Result<BinnedCustomMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

and aggregation.

§Arguments
  • pool - The database connection pool
  • params - The drift request parameters
§Returns
  • BinnedCustomMetrics
Source

fn merge_feature_results( results: BinnedCustomMetrics, map: &mut BinnedCustomMetrics, ) -> Result<(), SqlError>

Helper for merging custom drift records

Source

fn get_archived_records<'life0, 'life1, 'async_trait>( params: &'life0 DriftRequest, begin: DateTime<Utc>, end: DateTime<Utc>, minutes: i32, storage_settings: &'life1 ObjectStorageSettings, ) -> Pin<Box<dyn Future<Output = Result<BinnedCustomMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

DataFusion implementation for getting custom drift records from archived data.

§Arguments
  • params - The drift request parameters
  • begin - The start time of the time window
  • end - The end time of the time window
  • minutes - The number of minutes to bin the data
  • storage_settings - The object storage settings
§Returns
  • A vector of drift records
Source

fn get_binned_custom_drift_records<'life0, 'life1, 'life2, 'life3, 'async_trait>( pool: &'life0 Pool<Postgres>, params: &'life1 DriftRequest, retention_period: &'life2 i32, storage_settings: &'life3 ObjectStorageSettings, ) -> Pin<Box<dyn Future<Output = Result<BinnedCustomMetrics, SqlError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§