pub trait LLMDriftSqlLogic {
// Provided methods
fn insert_llm_drift_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 LLMDriftServerRecord,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn insert_llm_metric_values_batch<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [LLMMetricRecord],
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_llm_drift_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
service_info: &'life1 ServiceInfo,
limit_datetime: Option<&'life2 DateTime<Utc>>,
status: Option<Status>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LLMDriftServerRecord>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_llm_drift_records_pagination<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
service_info: &'life1 ServiceInfo,
status: Option<Status>,
pagination: PaginationRequest,
) -> Pin<Box<dyn Future<Output = Result<PaginationResponse<LLMDriftServerRecord>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_llm_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<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn merge_feature_results(
results: BinnedMetrics,
map: &mut BinnedMetrics,
) -> Result<(), SqlError> { ... }
fn get_archived_metric_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<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_binned_llm_metric_values<'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<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn get_pending_llm_drift_record<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Option<LLMRecord>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait { ... }
fn update_llm_drift_record_status<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 LLMRecord,
status: Status,
workflow_duration: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Provided Methods§
Sourcefn insert_llm_drift_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 LLMDriftServerRecord,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_llm_drift_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 LLMDriftServerRecord,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn insert_llm_metric_values_batch<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [LLMMetricRecord],
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_llm_metric_values_batch<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [LLMMetricRecord],
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Inserts a batch of LLM metric values into the database. This is the output from processing/evaluating the LLM drift records.
fn get_llm_drift_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
service_info: &'life1 ServiceInfo,
limit_datetime: Option<&'life2 DateTime<Utc>>,
status: Option<Status>,
) -> Pin<Box<dyn Future<Output = Result<Vec<LLMDriftServerRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn get_llm_drift_records_pagination<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
service_info: &'life1 ServiceInfo,
status: Option<Status>,
pagination: PaginationRequest,
) -> Pin<Box<dyn Future<Output = Result<PaginationResponse<LLMDriftServerRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn get_llm_drift_records_pagination<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
service_info: &'life1 ServiceInfo,
status: Option<Status>,
pagination: PaginationRequest,
) -> Pin<Box<dyn Future<Output = Result<PaginationResponse<LLMDriftServerRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a paginated list of LLM drift records from the database for a given service.
§Arguments
pool
- The database connection poolservice_info
- The service information to filter records bystatus
- Optional status filter for the recordspagination
- The pagination request containing limit and cursor
§Returns
- A result containing a pagination response with LLM drift records or an error
fn get_llm_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,
Sourcefn get_records<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
minutes: i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn get_records<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
minutes: i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: '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_metric_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<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn get_archived_metric_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<BinnedMetrics, 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 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_llm_metric_values<'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<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn get_pending_llm_drift_record<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Option<LLMRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn get_pending_llm_drift_record<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Option<LLMRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Retrieves the next pending LLM drift task from drift_records.
fn update_llm_drift_record_status<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 LLMRecord,
status: Status,
workflow_duration: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: '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.