Trait SpcSqlLogic

Source
pub trait SpcSqlLogic {
    // Provided methods
    fn insert_spc_drift_record<'life0, 'life1, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        record: &'life1 SpcServerRecord,
    ) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_spc_features<'life0, 'life1, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        service_info: &'life1 ServiceInfo,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_spc_drift_records<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        service_info: &'life1 ServiceInfo,
        limit_datetime: &'life2 DateTime<Utc>,
        features_to_monitor: &'life3 [String],
    ) -> Pin<Box<dyn Future<Output = Result<SpcDriftFeatures, SqlError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             '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<SpcDriftFeatures, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn merge_feature_results(
        results: SpcDriftFeatures,
        map: &mut SpcDriftFeatures,
    ) -> 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<SpcDriftFeatures, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_binned_spc_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<SpcDriftFeatures, 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_spc_drift_record<'life0, 'life1, 'async_trait>( pool: &'life0 Pool<Postgres>, record: &'life1 SpcServerRecord, ) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

Inserts a drift record into the database

§Arguments
  • record - A drift record to insert into the database
  • table_name - The name of the table to insert the record into
Source

fn get_spc_features<'life0, 'life1, 'async_trait>( pool: &'life0 Pool<Postgres>, service_info: &'life1 ServiceInfo, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Get SPC drift records

§Arguments
  • service_info - The service to get drift records for
  • limit_datetime - The limit datetime to get drift records for
  • features_to_monitor - The features to monitor
Source

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

Queries the database for SPC drift records based on a time window and aggregation.

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

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

Helper for merging current and archived binned spc 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<SpcDriftFeatures, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

DataFusion implementation for getting spc 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_spc_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<SpcDriftFeatures, 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§