0.0.9 • Published 3 months ago

@types/node-dogstatsd v0.0.9

Weekly downloads
41,436
License
MIT
Repository
github
Last release
3 months ago

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.

0.0.9

3 months ago

0.0.8

6 months ago

0.0.7

7 months ago

0.0.6

8 months ago

0.0.5

3 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

8 years ago

0.0.1

8 years ago