Skip to content

Commit

Permalink
store histogram as null if not availabe
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Mar 28, 2024
1 parent a135ed6 commit 86ab802
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion benchrunner-service/src/postgres/metrics_dbstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl BenchMetricsPostgresSaver for BenchRunnerConfirmationRateImpl {
&(metric.txs_confirmed as i64),
&(metric.txs_un_confirmed as i64),
&(metric.average_confirmation_time),
&(metric.histogram_confirmation_time),
&empty_vec_to_null(&metric.histogram_confirmation_time),
&(metric.average_slot_confirmation_time),
&metricjson,
];
Expand Down Expand Up @@ -148,3 +148,12 @@ impl BenchMetricsPostgresSaver for BenchRunnerConfirmationRateImpl {
Ok(())
}
}

#[allow(dead_code)]
fn empty_vec_to_null<T>(vec: &Vec<T>) -> Option<&Vec<T>> {
if vec.is_empty() {
None
} else {
Some(vec)
}
}

0 comments on commit 86ab802

Please sign in to comment.