The libp2p metrics tracking object. This interface is only concerned with the collection of metrics, please see the individual implementations for how to extract metrics for viewing.

Hierarchy

  • Metrics

Properties

registerCounter: ((name: string, options?: MetricOptions) => Counter) & ((name: string, options: CalculatedMetricOptions<number>) => void)

Register an arbitrary counter. Call this to set help/labels for counters and increment them by calling methods on the returned counter object

registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number>>) => void)

Register a a group of related counters. Call this to set help/labels for groups of related counters that will be updated with by calling the .increment method on the returned counter group object

registerMetric: ((name: string, options?: MetricOptions) => Metric) & ((name: string, options: CalculatedMetricOptions<number>) => void)

Register an arbitrary metric. Call this to set help/labels for metrics and update/increment/decrement/etc them by calling methods on the returned metric object

registerMetricGroup: ((name: string, options?: MetricOptions) => MetricGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number>>) => void)

Register a a group of related metrics. Call this to set help/labels for groups of related metrics that will be updated with by calling .update, .increment and/or .decrement methods on the returned metric group object

trackMultiaddrConnection: ((maConn: MultiaddrConnection) => void)

Type declaration

trackProtocolStream: ((stream: Stream, connection: Connection) => void)

Type declaration