@types/node-dogstatsd
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

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.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/node-dogstatsd

Weekly Downloads

8,059

Version

0.0.9

License

MIT

Unpacked Size

6.06 kB

Total Files

5

Last publish

Collaborators

  • types