@nitin15j/plugin-dora-frontend
Version:
Welcome to the dora-frontend plugin!
22 lines (19 loc) • 670 B
JavaScript
import { MetricType } from '../types/metrics.esm.js';
const formatMetricValue = (value, metricType) => {
switch (metricType) {
case MetricType.Frequency:
return `${value.toFixed(2)}/day`;
case MetricType.LeadTime:
const hours = value / 3600;
return hours >= 1 ? `${hours.toFixed(1)}h` : `${(value / 60).toFixed(1)}m`;
case MetricType.FailureRate:
return `${value.toFixed(1)}%`;
case MetricType.Mttr:
const minutes = value / 60;
return minutes >= 1 ? `${minutes.toFixed(1)}m` : `${value}s`;
default:
return value.toString();
}
};
export { formatMetricValue };
//# sourceMappingURL=formatters.esm.js.map