Installation
npm install --save @types/node-dogstatsd
Summary
This package contains type definitions for node-dogstatsd (https://github.com/joybro/node-dogstatsd).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-dogstatsd.
index.d.ts
/// <reference types="node" />
declare module "node-dogstatsd" {
import * as dgram from "dgram";
export interface StatsDOptions {
global_tags?: string[] | undefined;
}
export interface StatsDClient {
timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void;
increment(stat: string, sample_rate?: number, tags?: string[]): void;
incrementBy(stat: string, value: number, tags?: string[]): void;
decrement(stat: string, sample_rate?: number, tags?: string[]): void;
decrementBy(stat: string, value: number, tags?: string[]): void;
gauge(stat: string, value: number, sample_rate?: number, tags?: string[]): void;
histogram(stat: string, time: number, sample_rate?: number, tags?: string[]): void;
}
export class StatsD implements StatsDClient {
public socket: dgram.Socket;
constructor(host?: string, port?: number, socket?: dgram.Socket, options?: StatsDOptions);
timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void;
increment(stat: string, sample_rate?: number, tags?: string[]): void;
incrementBy(stat: string, value: number, tags?: string[]): void;
decrement(stat: string, sample_rate?: number, tags?: string[]): void;
decrementBy(stat: string, value: number, tags?: string[]): void;
gauge(stat: string, value: number, sample_rate?: number, tags?: string[]): void;
histogram(stat: string, time: number, sample_rate?: number, tags?: string[]): void;
close(): void;
}
}
Additional Details
- Last updated: Fri, 23 Feb 2024 14:35:20 GMT
- Dependencies: @types/node
Credits
These definitions were written by Chris Bobo, and Michael Mifsud.