/** * @since 2.0.0 */ import type * as Duration from "./Duration.js" import type * as Effect from "./Effect.js" import type { LazyArg } from "./Function.js" import * as fiberRuntime from "./internal/fiberRuntime.js" import * as internal from "./internal/metric.js" import type * as MetricBoundaries from "./MetricBoundaries.js" import type * as MetricKey from "./MetricKey.js" import type * as MetricKeyType from "./MetricKeyType.js" import type * as MetricLabel from "./MetricLabel.js" import type * as MetricPair from "./MetricPair.js" import type * as MetricRegistry from "./MetricRegistry.js" import type * as MetricState from "./MetricState.js" import type { Pipeable } from "./Pipeable.js" import type * as Types from "./Types.js" /** * @since 2.0.0 * @category symbols */ export const MetricTypeId: unique symbol = internal.MetricTypeId /** * @since 2.0.0 * @category symbols */ export type MetricTypeId = typeof MetricTypeId /** * A `Metric` represents a concurrent metric which accepts * updates of type `In` and are aggregated to a stateful value of type `Out`. * * For example, a counter metric would have type `Metric`, * representing the fact that the metric can be updated with numbers (the amount * to increment or decrement the counter by), and the state of the counter is a * number. * * There are five primitive metric types supported by Effect: * * - Counters * - Frequencies * - Gauges * - Histograms * - Summaries * * @since 2.0.0 * @category models */ export interface Metric extends Metric.Variance, Pipeable { /** * The type of the underlying primitive metric. For example, this could be * `MetricKeyType.Counter` or `MetricKeyType.Gauge`. */ readonly keyType: Type unsafeUpdate(input: In, extraTags: ReadonlyArray): void unsafeValue(extraTags: ReadonlyArray): Out unsafeModify(input: In, extraTags: ReadonlyArray): void register(): this (effect: Effect.Effect): Effect.Effect } /** * @since 2.0.0 * @category models */ export interface MetricApply { ( keyType: Type, unsafeUpdate: (input: In, extraTags: ReadonlyArray) => void, unsafeValue: (extraTags: ReadonlyArray) => Out, unsafeModify: (input: In, extraTags: ReadonlyArray) => void ): Metric } /** * @since 2.0.0 */ export declare namespace Metric { /** * @since 2.0.0 * @category models */ export interface Counter extends Metric, In, MetricState.MetricState.Counter> {} /** * @since 2.0.0 * @category models */ export interface Gauge extends Metric, In, MetricState.MetricState.Gauge> {} /** * @since 2.0.0 * @category models */ export interface Frequency extends Metric {} /** * @since 2.0.0 * @category models */ export interface Histogram extends Metric {} /** * @since 2.0.0 * @category models */ export interface Summary extends Metric {} /** * @since 2.0.0 * @category models */ export interface Variance { readonly [MetricTypeId]: { readonly _Type: Types.Invariant readonly _In: Types.Contravariant readonly _Out: Types.Covariant } } } /** * @since 2.0.0 * @category globals */ export const globalMetricRegistry: MetricRegistry.MetricRegistry = internal.globalMetricRegistry /** * @since 2.0.0 * @category constructors */ export const make: MetricApply = internal.make /** * Returns a new metric that is powered by this one, but which accepts updates * of the specified new type, which must be transformable to the input type of * this metric. * * @since 2.0.0 * @category mapping */ export const mapInput: { /** * Returns a new metric that is powered by this one, but which accepts updates * of the specified new type, which must be transformable to the input type of * this metric. * * @since 2.0.0 * @category mapping */ (f: (input: In2) => In): (self: Metric) => Metric /** * Returns a new metric that is powered by this one, but which accepts updates * of the specified new type, which must be transformable to the input type of * this metric. * * @since 2.0.0 * @category mapping */ (self: Metric, f: (input: In2) => In): Metric } = internal.mapInput /** * Represents a Counter metric that tracks cumulative numerical values over time. * Counters can be incremented and decremented and provide a running total of changes. * * **Options** * * - description - A description of the counter. * - bigint - Indicates if the counter uses 'bigint' data type. * - incremental - Set to 'true' for a counter that only increases. With this configuration, Effect ensures that non-incremental updates have no impact on the counter, making it exclusively suitable for counting upwards. * * @example * ```ts * import { Metric } from "effect" * * const numberCounter = Metric.counter("count", { * description: "A number counter" * }); * * const bigintCounter = Metric.counter("count", { * description: "A bigint counter", * bigint: true * }); * ``` * * @since 2.0.0 * @category constructors */ export const counter: { /** * Represents a Counter metric that tracks cumulative numerical values over time. * Counters can be incremented and decremented and provide a running total of changes. * * **Options** * * - description - A description of the counter. * - bigint - Indicates if the counter uses 'bigint' data type. * - incremental - Set to 'true' for a counter that only increases. With this configuration, Effect ensures that non-incremental updates have no impact on the counter, making it exclusively suitable for counting upwards. * * @example * ```ts * import { Metric } from "effect" * * const numberCounter = Metric.counter("count", { * description: "A number counter" * }); * * const bigintCounter = Metric.counter("count", { * description: "A bigint counter", * bigint: true * }); * ``` * * @since 2.0.0 * @category constructors */ ( name: string, options?: { readonly description?: string | undefined readonly bigint?: false | undefined readonly incremental?: boolean | undefined } ): Metric.Counter /** * Represents a Counter metric that tracks cumulative numerical values over time. * Counters can be incremented and decremented and provide a running total of changes. * * **Options** * * - description - A description of the counter. * - bigint - Indicates if the counter uses 'bigint' data type. * - incremental - Set to 'true' for a counter that only increases. With this configuration, Effect ensures that non-incremental updates have no impact on the counter, making it exclusively suitable for counting upwards. * * @example * ```ts * import { Metric } from "effect" * * const numberCounter = Metric.counter("count", { * description: "A number counter" * }); * * const bigintCounter = Metric.counter("count", { * description: "A bigint counter", * bigint: true * }); * ``` * * @since 2.0.0 * @category constructors */ ( name: string, options: { readonly description?: string | undefined readonly bigint: true readonly incremental?: boolean | undefined } ): Metric.Counter } = internal.counter /** * Creates a Frequency metric to count occurrences of events. * Frequency metrics are used to count the number of times specific events or incidents occur. * * @example * ```ts * import { Metric } from "effect" * * const errorFrequency = Metric.frequency("error_frequency", { * description: "Counts the occurrences of errors." * }); * ``` * * @since 2.0.0 * @category constructors */ export const frequency: ( name: string, options?: | { readonly description?: string | undefined; readonly preregisteredWords?: ReadonlyArray | undefined } | undefined ) => Metric.Frequency = internal.frequency /** * Returns a new metric that is powered by this one, but which accepts updates * of any type, and translates them to updates with the specified constant * update value. * * @since 2.0.0 * @category constructors */ export const withConstantInput: { /** * Returns a new metric that is powered by this one, but which accepts updates * of any type, and translates them to updates with the specified constant * update value. * * @since 2.0.0 * @category constructors */ (input: In): (self: Metric) => Metric /** * Returns a new metric that is powered by this one, but which accepts updates * of any type, and translates them to updates with the specified constant * update value. * * @since 2.0.0 * @category constructors */ (self: Metric, input: In): Metric } = internal.withConstantInput /** * @since 2.0.0 * @category constructors */ export const fromMetricKey: >( key: MetricKey.MetricKey ) => Metric, MetricKeyType.MetricKeyType.OutType> = internal.fromMetricKey /** * Represents a Gauge metric that tracks and reports a single numerical value at a specific moment. * Gauges are suitable for metrics that represent instantaneous values, such as memory usage or CPU load. * * **Options** * * - description - A description of the gauge metric. * - bigint - Indicates if the counter uses 'bigint' data type. * * @example * ```ts * import { Metric } from "effect" * * const numberGauge = Metric.gauge("memory_usage", { * description: "A gauge for memory usage" * }); * * const bigintGauge = Metric.gauge("cpu_load", { * description: "A gauge for CPU load", * bigint: true * }); * ``` * * @since 2.0.0 * @category constructors */ export const gauge: { /** * Represents a Gauge metric that tracks and reports a single numerical value at a specific moment. * Gauges are suitable for metrics that represent instantaneous values, such as memory usage or CPU load. * * **Options** * * - description - A description of the gauge metric. * - bigint - Indicates if the counter uses 'bigint' data type. * * @example * ```ts * import { Metric } from "effect" * * const numberGauge = Metric.gauge("memory_usage", { * description: "A gauge for memory usage" * }); * * const bigintGauge = Metric.gauge("cpu_load", { * description: "A gauge for CPU load", * bigint: true * }); * ``` * * @since 2.0.0 * @category constructors */ ( name: string, options?: { readonly description?: string | undefined readonly bigint?: false | undefined } ): Metric.Gauge /** * Represents a Gauge metric that tracks and reports a single numerical value at a specific moment. * Gauges are suitable for metrics that represent instantaneous values, such as memory usage or CPU load. * * **Options** * * - description - A description of the gauge metric. * - bigint - Indicates if the counter uses 'bigint' data type. * * @example * ```ts * import { Metric } from "effect" * * const numberGauge = Metric.gauge("memory_usage", { * description: "A gauge for memory usage" * }); * * const bigintGauge = Metric.gauge("cpu_load", { * description: "A gauge for CPU load", * bigint: true * }); * ``` * * @since 2.0.0 * @category constructors */ ( name: string, options: { readonly description?: string | undefined readonly bigint: true } ): Metric.Gauge } = internal.gauge /** * Represents a Histogram metric that records observations in specified value boundaries. * Histogram metrics are useful for measuring the distribution of values within a range. * * @example * ```ts * import { Metric, MetricBoundaries } from "effect" * * const latencyHistogram = Metric.histogram("latency_histogram", * MetricBoundaries.linear({ start: 0, width: 10, count: 11 }), * "Measures the distribution of request latency." * ); * ``` * * @since 2.0.0 * @category constructors */ export const histogram: ( name: string, boundaries: MetricBoundaries.MetricBoundaries, description?: string ) => Metric = internal.histogram /** * @since 2.0.0 * @category combinators */ export const increment: ( self: Metric.Counter | Metric.Counter | Metric.Gauge | Metric.Gauge ) => Effect.Effect = internal.increment /** * @since 2.0.0 * @category combinators */ export const incrementBy: { /** * @since 2.0.0 * @category combinators */ (amount: number): (self: Metric.Counter | Metric.Counter) => Effect.Effect /** * @since 2.0.0 * @category combinators */ (amount: bigint): (self: Metric.Counter | Metric.Gauge) => Effect.Effect /** * @since 2.0.0 * @category combinators */ (self: Metric.Counter | Metric.Gauge, amount: number): Effect.Effect /** * @since 2.0.0 * @category combinators */ (self: Metric.Counter | Metric.Gauge, amount: bigint): Effect.Effect } = internal.incrementBy /** * Returns a new metric that is powered by this one, but which outputs a new * state type, determined by transforming the state type of this metric by the * specified function. * * @since 2.0.0 * @category mapping */ export const map: { /** * Returns a new metric that is powered by this one, but which outputs a new * state type, determined by transforming the state type of this metric by the * specified function. * * @since 2.0.0 * @category mapping */ (f: (out: Out) => Out2): (self: Metric) => Metric /** * Returns a new metric that is powered by this one, but which outputs a new * state type, determined by transforming the state type of this metric by the * specified function. * * @since 2.0.0 * @category mapping */ (self: Metric, f: (out: Out) => Out2): Metric } = internal.map /** * @since 2.0.0 * @category mapping */ export const mapType: { /** * @since 2.0.0 * @category mapping */ (f: (type: Type) => Type2): (self: Metric) => Metric /** * @since 2.0.0 * @category mapping */ (self: Metric, f: (type: Type) => Type2): Metric } = internal.mapType /** * Modifies the metric with the specified update message. For example, if the * metric were a gauge, the update would increment the method by the provided * amount. * * @since 3.6.5 * @category utils */ export const modify: { /** * Modifies the metric with the specified update message. For example, if the * metric were a gauge, the update would increment the method by the provided * amount. * * @since 3.6.5 * @category utils */ (input: In): (self: Metric) => Effect.Effect /** * Modifies the metric with the specified update message. For example, if the * metric were a gauge, the update would increment the method by the provided * amount. * * @since 3.6.5 * @category utils */ (self: Metric, input: In): Effect.Effect } = internal.modify /** * @since 2.0.0 * @category aspects */ export const set: { /** * @since 2.0.0 * @category aspects */ (value: number): (self: Metric.Gauge) => Effect.Effect /** * @since 2.0.0 * @category aspects */ (value: bigint): (self: Metric.Gauge) => Effect.Effect /** * @since 2.0.0 * @category aspects */ (self: Metric.Gauge, value: number): Effect.Effect /** * @since 2.0.0 * @category aspects */ (self: Metric.Gauge, value: bigint): Effect.Effect } = internal.set /** * Captures a snapshot of all metrics recorded by the application. * * @since 2.0.0 * @category getters */ export const snapshot: Effect.Effect> = internal.snapshot /** * Creates a metric that ignores input and produces constant output. * * @since 2.0.0 * @category constructors */ export const succeed: (out: Out) => Metric = internal.succeed /** * Creates a metric that ignores input and produces constant output. * * @since 2.0.0 * @category constructors */ export const sync: (evaluate: LazyArg) => Metric = internal.sync /** * Creates a Summary metric that records observations and calculates quantiles. * Summary metrics provide statistical information about a set of values, including quantiles. * * **Options** * * - name - The name of the Summary metric. * - maxAge - The maximum age of observations to retain. * - maxSize - The maximum number of observations to keep. * - error - The error percentage when calculating quantiles. * - quantiles - An `Chunk` of quantiles to calculate (e.g., [0.5, 0.9]). * - description - An optional description of the Summary metric. * * @example * ```ts * import { Metric, Chunk } from "effect" * * const responseTimesSummary = Metric.summary({ * name: "response_times_summary", * maxAge: "60 seconds", // Retain observations for 60 seconds. * maxSize: 1000, // Keep a maximum of 1000 observations. * error: 0.01, // Allow a 1% error when calculating quantiles. * quantiles: [0.5, 0.9, 0.99], // Calculate 50th, 90th, and 99th percentiles. * description: "Measures the distribution of response times." * }); * ``` * * @since 2.0.0 * @category constructors */ export const summary: ( options: { readonly name: string readonly maxAge: Duration.DurationInput readonly maxSize: number readonly error: number readonly quantiles: ReadonlyArray readonly description?: string | undefined } ) => Metric.Summary = internal.summary /** * @since 2.0.0 * @category constructors */ export const summaryTimestamp: ( options: { readonly name: string readonly maxAge: Duration.DurationInput readonly maxSize: number readonly error: number readonly quantiles: ReadonlyArray readonly description?: string | undefined } ) => Metric.Summary // readonly because contravariant = internal.summaryTimestamp /** * Returns a new metric, which is identical in every way to this one, except * the specified tags have been added to the tags of this metric. * * @since 2.0.0 * @category utils */ export const tagged: { /** * Returns a new metric, which is identical in every way to this one, except * the specified tags have been added to the tags of this metric. * * @since 2.0.0 * @category utils */ (key: string, value: string): (self: Metric) => Metric /** * Returns a new metric, which is identical in every way to this one, except * the specified tags have been added to the tags of this metric. * * @since 2.0.0 * @category utils */ (self: Metric, key: string, value: string): Metric } = internal.tagged /** * Returns a new metric, which is identical in every way to this one, except * dynamic tags are added based on the update values. Note that the metric * returned by this method does not return any useful information, due to the * dynamic nature of the added tags. * * @since 2.0.0 * @category utils */ export const taggedWithLabelsInput: { /** * Returns a new metric, which is identical in every way to this one, except * dynamic tags are added based on the update values. Note that the metric * returned by this method does not return any useful information, due to the * dynamic nature of the added tags. * * @since 2.0.0 * @category utils */ (f: (input: In) => Iterable): (self: Metric) => Metric /** * Returns a new metric, which is identical in every way to this one, except * dynamic tags are added based on the update values. Note that the metric * returned by this method does not return any useful information, due to the * dynamic nature of the added tags. * * @since 2.0.0 * @category utils */ ( self: Metric, f: (input: In) => Iterable ): Metric } = internal.taggedWithLabelsInput /** * Returns a new metric, which is identical in every way to this one, except * the specified tags have been added to the tags of this metric. * * @since 2.0.0 * @category utils */ export const taggedWithLabels: { /** * Returns a new metric, which is identical in every way to this one, except * the specified tags have been added to the tags of this metric. * * @since 2.0.0 * @category utils */ (extraTags: Iterable): (self: Metric) => Metric /** * Returns a new metric, which is identical in every way to this one, except * the specified tags have been added to the tags of this metric. * * @since 2.0.0 * @category utils */ (self: Metric, extraTags: Iterable): Metric } = internal.taggedWithLabels /** * 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"`). * * @since 2.0.0 * @category constructors */ export const timer: ( name: string, description?: string ) => Metric = internal.timer /** * Creates a timer metric, based on a histogram created from the provided * boundaries, 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"`). * * @since 2.0.0 * @category constructors */ export const timerWithBoundaries: ( name: string, boundaries: ReadonlyArray, description?: string ) => Metric = internal.timerWithBoundaries /** * Returns an aspect that will update this metric with the specified constant * value every time the aspect is applied to an effect, regardless of whether * that effect fails or succeeds. * * @since 2.0.0 * @category aspects */ export const trackAll: { /** * Returns an aspect that will update this metric with the specified constant * value every time the aspect is applied to an effect, regardless of whether * that effect fails or succeeds. * * @since 2.0.0 * @category aspects */ (input: In): (self: Metric) => (effect: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the specified constant * value every time the aspect is applied to an effect, regardless of whether * that effect fails or succeeds. * * @since 2.0.0 * @category aspects */ (self: Metric, input: In): (effect: Effect.Effect) => Effect.Effect } = internal.trackAll /** * Returns an aspect that will update this metric with the defects of the * effects that it is applied to. * * @since 2.0.0 * @category aspects */ export const trackDefect: { /** * Returns an aspect that will update this metric with the defects of the * effects that it is applied to. * * @since 2.0.0 * @category aspects */ (metric: Metric): (self: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the defects of the * effects that it is applied to. * * @since 2.0.0 * @category aspects */ (self: Effect.Effect, metric: Metric): Effect.Effect } = internal.trackDefect /** * Returns an aspect that will update this metric with the result of applying * the specified function to the defect throwables of the effects that the * aspect is applied to. * * @since 2.0.0 * @category aspects */ export const trackDefectWith: { /** * Returns an aspect that will update this metric with the result of applying * the specified function to the defect throwables of the effects that the * aspect is applied to. * * @since 2.0.0 * @category aspects */ (metric: Metric, f: (defect: unknown) => In): (self: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the result of applying * the specified function to the defect throwables of the effects that the * aspect is applied to. * * @since 2.0.0 * @category aspects */ ( self: Effect.Effect, metric: Metric, f: (defect: unknown) => In ): Effect.Effect } = internal.trackDefectWith /** * Returns an aspect that will update this metric with the duration that the * effect takes to execute. To call this method, the input type of the metric * must be `Duration`. * * @since 2.0.0 * @category aspects */ export const trackDuration: { /** * Returns an aspect that will update this metric with the duration that the * effect takes to execute. To call this method, the input type of the metric * must be `Duration`. * * @since 2.0.0 * @category aspects */ (metric: Metric): (self: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the duration that the * effect takes to execute. To call this method, the input type of the metric * must be `Duration`. * * @since 2.0.0 * @category aspects */ (self: Effect.Effect, metric: Metric): Effect.Effect } = internal.trackDuration /** * Returns an aspect that will update this metric with the duration that the * effect takes to execute. To call this method, you must supply a function * that can convert the `Duration` to the input type of this metric. * * @since 2.0.0 * @category aspects */ export const trackDurationWith: { /** * Returns an aspect that will update this metric with the duration that the * effect takes to execute. To call this method, you must supply a function * that can convert the `Duration` to the input type of this metric. * * @since 2.0.0 * @category aspects */ (metric: Metric, f: (duration: Duration.Duration) => In): (effect: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the duration that the * effect takes to execute. To call this method, you must supply a function * that can convert the `Duration` to the input type of this metric. * * @since 2.0.0 * @category aspects */ ( self: Effect.Effect, metric: Metric, f: (duration: Duration.Duration) => In ): Effect.Effect } = internal.trackDurationWith /** * Returns an aspect that will update this metric with the failure value of * the effects that it is applied to. * * @since 2.0.0 * @category aspects */ export const trackError: { /** * Returns an aspect that will update this metric with the failure value of * the effects that it is applied to. * * @since 2.0.0 * @category aspects */ (metric: Metric): (self: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the failure value of * the effects that it is applied to. * * @since 2.0.0 * @category aspects */ (self: Effect.Effect, metric: Metric): Effect.Effect } = internal.trackError /** * Returns an aspect that will update this metric with the result of applying * the specified function to the error value of the effects that the aspect is * applied to. * * @since 2.0.0 * @category aspects */ export const trackErrorWith: { /** * Returns an aspect that will update this metric with the result of applying * the specified function to the error value of the effects that the aspect is * applied to. * * @since 2.0.0 * @category aspects */ (metric: Metric, f: (error: In2) => In): (effect: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the result of applying * the specified function to the error value of the effects that the aspect is * applied to. * * @since 2.0.0 * @category aspects */ ( self: Effect.Effect, metric: Metric, f: (error: In2) => In ): Effect.Effect } = internal.trackErrorWith /** * Returns an aspect that will update this metric with the success value of * the effects that it is applied to. * * @since 2.0.0 * @category aspects */ export const trackSuccess: { /** * Returns an aspect that will update this metric with the success value of * the effects that it is applied to. * * @since 2.0.0 * @category aspects */ (metric: Metric): (self: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the success value of * the effects that it is applied to. * * @since 2.0.0 * @category aspects */ (self: Effect.Effect, metric: Metric): Effect.Effect } = internal.trackSuccess /** * Returns an aspect that will update this metric with the result of applying * the specified function to the success value of the effects that the aspect is * applied to. * * @since 2.0.0 * @category aspects */ export const trackSuccessWith: { /** * Returns an aspect that will update this metric with the result of applying * the specified function to the success value of the effects that the aspect is * applied to. * * @since 2.0.0 * @category aspects */ (metric: Metric, f: (value: Types.NoInfer) => In): (self: Effect.Effect) => Effect.Effect /** * Returns an aspect that will update this metric with the result of applying * the specified function to the success value of the effects that the aspect is * applied to. * * @since 2.0.0 * @category aspects */ ( self: Effect.Effect, metric: Metric, f: (value: Types.NoInfer) => In ): Effect.Effect } = internal.trackSuccessWith /** * Updates the metric with the specified update message. For example, if the * metric were a counter, the update would increment the method by the * provided amount. * * @since 2.0.0 * @category utils */ export const update: { /** * Updates the metric with the specified update message. For example, if the * metric were a counter, the update would increment the method by the * provided amount. * * @since 2.0.0 * @category utils */ (input: In): (self: Metric) => Effect.Effect /** * Updates the metric with the specified update message. For example, if the * metric were a counter, the update would increment the method by the * provided amount. * * @since 2.0.0 * @category utils */ (self: Metric, input: In): Effect.Effect } = internal.update /** * Retrieves a snapshot of the value of the metric at this moment in time. * * @since 2.0.0 * @category getters */ export const value: (self: Metric) => Effect.Effect = internal.value /** * @since 2.0.0 * @category utils */ export const withNow: (self: Metric) => Metric = internal.withNow /** * @since 2.0.0 * @category zipping */ export const zip: { /** * @since 2.0.0 * @category zipping */ (that: Metric): ( self: Metric ) => Metric< readonly [Type, Type2], // readonly because invariant readonly [In, In2], // readonly because contravariant [Out, Out2] > /** * @since 2.0.0 * @category zipping */ (self: Metric, that: Metric): Metric< readonly [Type, Type2], // readonly because invariant readonly [In, In2], // readonly because contravariant [Out, Out2] > } = internal.zip /** * Unsafely captures a snapshot of all metrics recorded by the application. * * @since 2.0.0 * @category unsafe */ export const unsafeSnapshot: (_: void) => ReadonlyArray = internal.unsafeSnapshot /** * @since 2.0.0 * @category metrics */ export const fiberStarted: Metric.Counter = fiberRuntime.fiberStarted /** * @since 2.0.0 * @category metrics */ export const fiberSuccesses: Metric.Counter = fiberRuntime.fiberSuccesses /** * @since 2.0.0 * @category metrics */ export const fiberFailures: Metric.Counter = fiberRuntime.fiberFailures /** * @since 2.0.0 * @category metrics */ export const fiberLifetimes: Metric = fiberRuntime.fiberLifetimes /** * @since 2.0.0 * @category metrics */ export const fiberActive: Metric.Counter = fiberRuntime.fiberActive