pub trait CustomMetricSqlLogic {
// Provided methods
fn insert_custom_metric_values_batch<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [CustomMetricRecord],
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_custom_metric_values<'life0, 'life1, 'life2, 'life3, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
metrics: &'life2 [String],
entity_id: &'life3 i32,
) -> 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, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn merge_feature_results(
results: BinnedMetrics,
map: &mut BinnedMetrics,
) -> Result<(), SqlError> { ... }
fn get_archived_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_binned_custom_drift_records<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
retention_period: &'life2 i32,
storage_settings: &'life3 ObjectStorageSettings,
entity_id: &'life4 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
}Provided Methods§
Sourcefn insert_custom_metric_values_batch<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [CustomMetricRecord],
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn insert_custom_metric_values_batch<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [CustomMetricRecord],
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Inserts a batch of custom metric values into the database
- This is an event route, so we need to get the entity_id from the uid
fn get_custom_metric_values<'life0, 'life1, 'life2, 'life3, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
metrics: &'life2 [String],
entity_id: &'life3 i32,
) -> 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,
Sourcefn get_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn merge_feature_results(
results: BinnedMetrics,
map: &mut BinnedMetrics,
) -> Result<(), SqlError>
fn merge_feature_results( results: BinnedMetrics, map: &mut BinnedMetrics, ) -> Result<(), SqlError>
Helper for merging custom drift records
Sourcefn get_archived_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_archived_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
DataFusion implementation for getting custom drift records from archived data.
§Arguments
params- The drift request parametersbegin- The start time of the time windowend- The end time of the time windowminutes- The number of minutes to bin the datastorage_settings- The object storage settings
§Returns
- A vector of drift records
fn get_binned_custom_drift_records<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
retention_period: &'life2 i32,
storage_settings: &'life3 ObjectStorageSettings,
entity_id: &'life4 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: '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.