New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@libp2p/interface-metrics

Package Overview
Dependencies
Maintainers
6
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/interface-metrics - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

24

dist/src/index.d.ts

@@ -20,3 +20,3 @@ import type { MultiaddrConnection, Stream, Connection } from '@libp2p/interface-connection';

*/
export declare type CalculateMetric<T = number | bigint> = (() => T) | (() => Promise<T>);
export declare type CalculateMetric<T = number> = (() => T) | (() => Promise<T>);
/**

@@ -26,3 +26,3 @@ * Create tracked metrics that are expensive to calculate by passing

*/
export interface CalculatedMetricOptions<T = number | bigint> extends MetricOptions {
export interface CalculatedMetricOptions<T = number> extends MetricOptions {
/**

@@ -49,11 +49,11 @@ * An optional function invoked to calculate the component metric instead of

*/
update: (value: number | bigint) => void;
update: (value: number) => void;
/**
* Increment the metric by the passed value or 1
*/
increment: (value?: number | bigint) => void;
increment: (value?: number) => void;
/**
* Decrement the metric by the passed value or 1
*/
decrement: (value?: number | bigint) => void;
decrement: (value?: number) => void;
/**

@@ -77,3 +77,3 @@ * Reset this metric to its default value

*/
update: (values: Record<string, number | bigint>) => void;
update: (values: Record<string, number>) => void;
/**

@@ -83,3 +83,3 @@ * Increment the metric group keys by the passed number or

*/
increment: (values: Record<string, number | bigint | unknown>) => void;
increment: (values: Record<string, number | unknown>) => void;
/**

@@ -89,3 +89,3 @@ * Decrement the metric group keys by the passed number or

*/
decrement: (values: Record<string, number | bigint | unknown>) => void;
decrement: (values: Record<string, number | unknown>) => void;
/**

@@ -110,3 +110,3 @@ * Reset the passed key in this metric group to its default value

*/
increment: (value?: number | bigint) => void;
increment: (value?: number) => void;
/**

@@ -127,3 +127,3 @@ * Reset this metric to its default value

*/
increment: (values: Record<string, number | bigint | unknown>) => void;
increment: (values: Record<string, number | unknown>) => void;
/**

@@ -160,3 +160,3 @@ * Reset the passed key in this metric group to its default value

*/
registerMetricGroup: ((name: string, options?: MetricOptions) => MetricGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number | bigint>>) => void);
registerMetricGroup: ((name: string, options?: MetricOptions) => MetricGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number>>) => void);
/**

@@ -172,4 +172,4 @@ * Register an arbitrary counter. Call this to set help/labels for counters

*/
registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number | bigint>>) => void);
registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number>>) => void);
}
//# sourceMappingURL=index.d.ts.map
{
"name": "@libp2p/interface-metrics",
"version": "4.0.1",
"version": "4.0.2",
"description": "Metrics interface for libp2p",

@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT",

@@ -23,3 +23,3 @@ import type { MultiaddrConnection, Stream, Connection } from '@libp2p/interface-connection'

*/
export type CalculateMetric<T = number | bigint> = (() => T) | (() => Promise<T>)
export type CalculateMetric<T = number> = (() => T) | (() => Promise<T>)

@@ -30,3 +30,3 @@ /**

*/
export interface CalculatedMetricOptions<T = number | bigint> extends MetricOptions {
export interface CalculatedMetricOptions<T = number> extends MetricOptions {
/**

@@ -53,3 +53,3 @@ * An optional function invoked to calculate the component metric instead of

*/
update: (value: number | bigint) => void
update: (value: number) => void

@@ -59,3 +59,3 @@ /**

*/
increment: (value?: number | bigint) => void
increment: (value?: number) => void

@@ -65,3 +65,3 @@ /**

*/
decrement: (value?: number | bigint) => void
decrement: (value?: number) => void

@@ -88,3 +88,3 @@ /**

*/
update: (values: Record<string, number | bigint>) => void
update: (values: Record<string, number>) => void

@@ -95,3 +95,3 @@ /**

*/
increment: (values: Record<string, number | bigint | unknown>) => void
increment: (values: Record<string, number | unknown>) => void

@@ -102,3 +102,3 @@ /**

*/
decrement: (values: Record<string, number | bigint | unknown>) => void
decrement: (values: Record<string, number | unknown>) => void

@@ -126,3 +126,3 @@ /**

*/
increment: (value?: number | bigint) => void
increment: (value?: number) => void

@@ -145,3 +145,3 @@ /**

*/
increment: (values: Record<string, number | bigint | unknown>) => void
increment: (values: Record<string, number | unknown>) => void

@@ -183,3 +183,3 @@ /**

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

@@ -197,3 +197,3 @@ /**

*/
registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number | bigint>>) => void)
registerCounterGroup: ((name: string, options?: MetricOptions) => CounterGroup) & ((name: string, options: CalculatedMetricOptions<Record<string, number>>) => void)
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc