2.0.20 • Published 3 days ago

nestjs-hot-shots v2.0.20

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

NestJS Hot-shots npm LICENSE Downloads Last Commit

Hot-shots Module for Nest.js Framework. A Node.js client for Etsy's StatsD server, Datadog's DogStatsD server, and InfluxDB's Telegraf StatsD server.

Features

  • TypeScript types
  • Telegraf support
  • Events
  • Child clients
  • TCP/UDS Protocol support
  • Raw Stream Protocol support
  • Mock mode
  • Much more, including many bug fixes

For questions and support please use the Issues.

Installation

$ npm i nestjs-hot-shots hot-shots
$ yarn add nestjs-hot-shots hot-shots
$ pnpm add nestjs-hot-shots hot-shots

Usage

Once the installation process is complete, we can import the HotShotsModule into the root AppModule:

import { Module } from '@nestjs/common'
import { HotShotsModule } from 'nestjs-hot-shots';

@Module({
    imports: [
        HotShotsModule.forRoot({
            port: 8020,
            globalTags: { env: process.env.NODE_ENV }
        })
    ]
})
export class AppModule {
}

Then inject StatsD provider for use hot-shots:

import { Injectable } from '@nestjs/common';
import { StatsD } from 'hot-shots';

@Injectable()
export class AppMetrics {
    public constructor(private readonly metrics: StatsD) {
    }

    public metricStuff() {
        this.metrics.increment('somecounter');
    }
}

See the hot-shots module for more details.

Stay in touch

License

MIT © Alexey Filippov

2.0.20

3 days ago

2.0.19

6 months ago

2.0.16

11 months ago

2.0.17

10 months ago

2.0.18

10 months ago

2.0.15

1 year ago

2.0.13

1 year ago

2.0.14

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.9

1 year ago

2.0.8

2 years ago

2.0.10

1 year ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago