effect-io-ai

Package: effect
Module: Metric

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

Example

import { Metric } from "effect"

const numberCounter = Metric.counter("count", {
  description: "A number counter"
});

const bigintCounter = Metric.counter("count", {
  description: "A bigint counter",
  bigint: true
});

Signature

declare const counter: { (name: string, options?: { readonly description?: string | undefined; readonly bigint?: false | undefined; readonly incremental?: boolean | undefined; }): Metric.Counter<number>; (name: string, options: { readonly description?: string | undefined; readonly bigint: true; readonly incremental?: boolean | undefined; }): Metric.Counter<bigint>; }

Source

Since v2.0.0