import { SemaphorePool, SemaphorePoolConfig } from './semaphore.js'; declare const outcomes: readonly ["fulfilled", "timedout", "canceled", "rejected", "unspecified"]; export type SemaphorePoolLabels = { pool: string; }; export type SemaphoreLabels = SemaphorePoolLabels & { operation: string; }; export type SemaphoreSettledLabels = SemaphorePoolLabels & SemaphoreLabels & { outcome: typeof outcomes[number]; }; export declare const defaultHistoBucketsMS: number[]; export type MetricOptions = { histogramBucketsMS?: number[]; }; interface CounterMetric { inc(labels: Record): void; init(labels: Record): void; } interface GaugeMetric { set(labels: Record, value: number): void; } interface HistogramMetric { observe(labels: Record, value: number): void; } export type SemaphoreMetrics = { requested: CounterMetric; released: CounterMetric; settled: CounterMetric; reserved: GaugeMetric; queued: GaugeMetric; concurrency: GaugeMetric; capacity: GaugeMetric; waittime: HistogramMetric; heldtime: HistogramMetric; }; export interface InstrumentedSemaphorePoolConfig extends SemaphorePoolConfig { defaultOperation?: string; } export default abstract class InstrumentedSemaphorePoolFactory { abstract get metrics(): SemaphoreMetrics; instrumentedPool(name: string, config: InstrumentedSemaphorePoolConfig): SemaphorePool; } export {};