const fileName_1 = "(@effect/core) _src/io/Metrics/operations/timer.ts";
import * as tsplus_module_1 from "@effect/core/io/Metrics/Boundaries";
import * as tsplus_module_2 from "@effect/core/io/Metrics/operations/histogram";
import * as tsplus_module_3 from "@effect/core/io/Metrics/operations/tagged";
import * as tsplus_module_4 from "@effect/core/io/Metrics/operations/contramap";
/**
 * Creates a timer metric, based on a histogram, which keeps track of
 * durations in milliseconds. The unit of time will automatically be added to
 * the metric as a tag (i.e. `"time_unit: milliseconds"`).
 */

export function timer(name) {
  const boundaries = tsplus_module_1.exponential(1, 2, 100);
  const base = tsplus_module_3.tagged_(tsplus_module_2.histogram(name, boundaries), "time_unit", "milliseconds");
  return tsplus_module_4.contramap_(base, duration => duration.millis, fileName_1 + ":9:24");
}
//# sourceMappingURL=timer.mjs.map