Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/statsd

Package Overview
Dependencies
Maintainers
18
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/statsd

An opinionated StatsD client for Shopify Node.js servers and other StatsD utilities

  • 3.0.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.6K
decreased by-82.22%
Maintainers
18
Weekly downloads
 
Created
Source

@shopify/statsd

Build Status Build Status License: MIT npm version

An opinionated StatsD client for Shopify Node.js servers and other StatsD utilities.

Installation

$ yarn add @shopify/statsd

Usage

Client

Create a StatsD client with the following:

import {StatsDClient} from '@shopify/statsd';

const statsdClient = new StatsDClient({
  host: 'some-statsd-host.com',
  port: '8125',
  prefix: 'AppName',
});
distribution

Tracks the statistical distribution of a set of values across your infrastructure.

statsdClient.distribution(
  'navigationComplete',
  100, // in milliseconds
  ['navigation', 'complete', 'performance'], // user-defined tags to go with the data
);
increment

Increments a stat by 1.

statsdClient.increment(
  'myCounter',
  ['navigation', 'complete', 'performance'], // user-defined tags to go with the data
);
close

Close statsd client. This will ensure all stats are sent and stop statsd from doing anything more.

statsdClient.close();

FAQs

Package last updated on 09 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc