var _a;

import * as tsplus_module_1 from "@tsplus/stdlib/structure/Hash";
import * as tsplus_module_2 from "@tsplus/stdlib/structure/Equals";
export const isMetricLabel = isMetricLabel_1;
export const MetricLabelSym = /*#__PURE__*/Symbol.for("@effect/core/io/Metrics/MetricLabel");
/**
 * A `MetricLabel` represents a key value pair that allows analyzing metrics at
 * an additional level of granularity.
 *
 * For example if a metric tracks the response time of a service labels could
 * be used to create separate versions that track response times for different
 * clients.
 *
 * @tsplus type ets/Metrics/MetricLabel
 * @tsplus companion ets/Metrics/MetricLabel/Ops
 */

export class MetricLabel {
  constructor(key, value) {
    this.key = key;
    this.value = value;
    this[_a] = MetricLabelSym;
  }

  [(_a = MetricLabelSym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.combine(tsplus_module_1.hashString(this.key), tsplus_module_1.hashString(this.value));
  }

  [tsplus_module_2.Equals.sym](that) {
    return isMetricLabel_1(that) && this[tsplus_module_1.Hash.sym]() === that[tsplus_module_1.Hash.sym]();
  }

}
/**
 * @tsplus static ets/Metrics/MetricLabel/Ops __call
 */

export function make(key, value) {
  return new MetricLabel(key, value);
}
/**
 * @tsplus static ets/Metrics/MetricLabel/Ops isMetricLabel
 */

function isMetricLabel_1(u) {
  return typeof u === "object" && u != null && MetricLabelSym in u;
}
//# sourceMappingURL=MetricLabel.mjs.map