import * as tsplus_module_1 from "@effect/core/io/Metrics/operations/registry";
/**
 * A `MetricClient` provides the functionality to consume metrics produced by
 * Effect applications. `MetricClient` supports two ways of consuming metrics,
 * corresponding to the two ways that third party metrics services use metrics.
 *
 * First, metrics services can poll for the current state of all recorded
 * metrics using the `unsafeSnapshot` method, which provides a snapshot, as of a
 * point in time, of all metrics recorded by the Effect application.
 *
 * Second, metrics services can install a listener that will be notified every
 * time a metric is updated.
 *
 * `MetricClient` is a lower level interface and is intended to be used by
 * implementers of integrations with third party metrics services but not by end
 * users.
 */

export const MetricClient = {};
/**
 * Unsafely installs the specified metric listener.
 *
 * @tsplus static ets/Metrics/MetricClient/Ops unsafeInstallListener
 */

export function unsafeInstallListener(listener) {
  tsplus_module_1.metricRegistry.value.installListener(listener);
}
/**
 * Unsafely removes the specified metric listener.
 *
 * @tsplus static ets/Metrics/MetricClient/Ops unsafeInstallListener
 */

export function unsafeRemoveListener(listener) {
  tsplus_module_1.metricRegistry.value.removeListener(listener);
}
/**
 * Unsafely captures a snapshot of all metrics recorded by the application.
 *
 * @tsplus static ets/Metrics/MetricClient/Ops unsafeSnapshot
 */

export function unsafeSnapshot() {
  return tsplus_module_1.metricRegistry.value.snapshot();
}
//# sourceMappingURL=MetricClient.mjs.map