async fn check_metrics(preference: &Monitor, context: &App) -> Result<Vec<AlertResult>> {
	let mut results = Vec::new();
	let current_training_value =
		find_current_data(preference.threshold.metric, preference.model_id, context).await?;
	let current_production_value =
		get_production_metric(preference.threshold.metric, preference.model_id, context).await?;
	if current_production_value.is_none() {
		return Err(anyhow!("Unable to find production metric value"));
	}
	let current_production_value = current_production_value.unwrap();
	let observed_variance = match preference.threshold.mode {
		MonitorThresholdMode::Absolute => current_training_value - current_production_value,
		MonitorThresholdMode::Percentage => todo!(),
	};

	results.push(AlertResult {
		metric: preference.threshold.metric,
		observed_value: current_training_value,
		observed_variance,
	});
	Ok(results)
}
/// Return the current observed values for each heuristic
Return the current observed values for each heuristic
Return the current observed values for each heuristic
async fn check_metrics(preference: &Monitor, context: &App) -> Result<Vec<AlertResult>> {
	let mut results = Vec::new();
	let current_training_value =
		find_current_data(preference.threshold.metric, preference.model_id, context).await?;
	let current_production_value =
		get_production_metric(preference.threshold.metric, preference.model_id, context).await?;
	if current_production_value.is_none() {
		return Err(anyhow!("Unable to find production metric value"));
	}
	let current_production_value = current_production_value.unwrap();
	let observed_variance = match preference.threshold.mode {
		MonitorThresholdMode::Absolute => current_training_value - current_production_value,
		MonitorThresholdMode::Percentage => todo!(),
	};
	results.push(AlertResult {
		metric: preference.threshold.metric,
		observed_value: current_training_value,
		observed_variance,
	});
	Ok(results)
}
async fn check_metrics ( preference : & Monitor , context : & App ) -> Result < Vec < AlertResult > > { let mut results = Vec :: new ( ) ; let current_training_value = find_current_data ( preference . threshold . metric , preference . model_id , context ) . await ? ; let current_production_value = get_production_metric ( preference . threshold . metric , preference . model_id , context ) . await ? ; if current_production_value . is_none ( ) { return Err ( anyhow ! ( " " ) ) ; } let current_production_value = current_production_value . unwrap ( ) ; let observed_variance = match preference . threshold . mode { MonitorThresholdMode :: Absolute => current_training_value - current_production_value , MonitorThresholdMode :: Percentage => todo ! ( ) , } ; results . push ( AlertResult { metric : preference . threshold . metric , observed_value : current_training_value , observed_variance , } ) ; Ok ( results ) }
Return the current observed values for each heuristic
Return the current observed values for each heuristic
preference
&Monitor
context
&App
preference
&Monitor
context
&App