Narrowly Preventing Mayhem

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

    0.0.5 • Public • Published

    Installation

    npm install --save @types/node-dogstatsd

    Summary

    This package contains type definitions for Datadog's nodejs metrics client 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

    // Type definitions for Datadog's nodejs metrics client node-dogstatsd
    // Project: https://github.com/joybro/node-dogstatsd
    // Definitions by: Chris Bobo <https://github.com/chrisbobo>
    //                 Michael Mifsud <https://github.com/xzyfer>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <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: Thu, 08 Jul 2021 18:51:19 GMT
    • Dependencies: @types/node
    • Global values: none

    Credits

    These definitions were written by Chris Bobo, and Michael Mifsud.

    Keywords

    none

    Install

    npm i @types/node-dogstatsd

    DownloadsWeekly Downloads

    10,842

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    6.6 kB

    Total Files

    4

    Last publish

    Collaborators

    • types