Skip to main content

read_final_metric

Function read_final_metric 

pub fn read_final_metric(meta_json: &str) -> Option<f64>
Expand description

Reads final_metric out of a checkpoints/meta.json document.

NOTE: a non-finite final_metric serializes to JSON null and will not deserialize back into f64, so a DIVERGED run surfaces here as None. Oniro now refuses to persist such a metric at all (its RunMeta::validate_final_metric), so a run that reaches this function with a null metric predates that guard.