npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

abdogstatsd

v0.0.10

Published

node client for extended StatsD server of Datadog

Downloads

11

Readme

node-dogstatsd

Aaron Brady: A fork of node-dogstatsd to add events. should eventually merge back with that project, just need the module now.

A node.js client for extended StatsD server of Datadog.

Datadog added new some features(histogram and tags) to their own StatsD implementation. This client is an extension of general StatsD client to work with that server.

Most parts of codes came from Steve Ivy's node-statsd. I just added few lines to support datadog's histogram and tags features.

The name of the package is changed because this isn't really statsd client and should be able to be used with original statsd client.

% npm install node-dogstatsd
% node
> var StatsD = require('node-dogstatsd').StatsD
> c = new StatsD('example.org',8125)
{ host: 'example.org', port: 8125 }
> c.increment('node_test.int')
> c.incrementBy('node_test.int', 7)
> c.decrement('node_test.int')
> c.decrementBy('node_test.int', 12)
> c.timing('node_test.some_service.task.time', 500) // time in millis
> c.histogram('node_test.some_service.data', 100) // works only with datadog' StatsD
> c.increment('node_test.int', 1, ['tag:one']) // works only with datadog' StatsD

License

node-statsd is licensed under the MIT license.

Error handling policy

  • exceptions "bubble up" into the app that uses this library
  • we don't log or print to console any errors ourself, it's the toplevel app that decides how to log/write to console.
  • we document which exceptions can be raised, and where. (TODO, https://github.com/sivy/node-statsd/issues/17)

in your main app, you can leverage the fact that you have access to c.socket and do something like: (this is the best way I've found so far)

c.socket.on('error', function (exception) {
   return console.log ("error event in socket.send(): " + exception);
});