private static MetricValue opt_duration_to_metricvalue_ ( Optional < Duration > duration ) { return duration . map ( MonitorMonitor :: duration_to_metricvalue_ ) . orElse ( MetricValue . EMPTY ) ; }
Convert an optional duration to a metric value .