@types/node-dogstatsd
@types/node-dogstatsd
npm i @types/node-dogstatsd
@types/node-dogstatsd

@types/node-dogstatsd

The repository for high quality TypeScript type definitions.

by DefinitelyTyped

0.0.5 (see all)License:MITTypeScript:Built-In
npm i @types/node-dogstatsd
Readme

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.

Downloads/wk

14.9K

GitHub Stars

40.9K

LAST COMMIT

7mos ago

MAINTAINERS

1

CONTRIBUTORS

17,572

OPEN ISSUES

635

OPEN PRs

201
VersionTagPublished
0.0.5
latest
1yr ago
0.0.5
ts4.7
1yr ago
0.0.5
ts4.6
1yr ago
0.0.5
ts4.8
1yr ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate