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

statsd-grapher

v0.1.2

Published

A statsd backend that serves an http page with the graphical data

Downloads

19

Readme

statsd-grapher

Build Status Coverage Status

:chart_with_upwards_trend: A statsd backend that serves an http page with the graphical data. This is an alternative to using graphite, and can simply be hosted on a free Heroku instance.

View the annotated source

Quick use

  1. Install and set up statsd-grapher
$ npm install statsd statsd-grapher --save
$ cp node_modules/statsd-grapher/exampleConfig.js .
$ ./node_modules/.bin/statsd exampleConfig.js
  1. Send some data to your statsd instance

  2. Go to your statsd http server to view the graph. The default would be localhost:3000/stats

Configuration

Options

tokens ([String]) - An array of tokens used to authenticate access to the graph. Makes it so that the data can only be accessed by an authenticated user (recommended)
expressPort (Integer) - The port on which the backend http server should run (default: 3000)
sessionStore (Object) - The session store object that will be passed into the store option for express-session (default: MemoryStore)
sessionSecret (String) - The session secret (default: uuid.v4())
sessionExpires (Integer) - The session expiration time in milliseconds (default: 3600000)

Urls

http(s)://hostname:port/stats - Views all stats. This page may be slow to load if you have a lot of metrics. http(s)://hostname:port/stats/:namespace/:metric - Views stats from a particular namespace and metric. If metric is set to all, then all metrics will be returned for that namespace. Ex: /stats/some.name.space/timers
http(s)://hostname:port/metrics/:type/:name - Returns a JSON representation of the metric. Ex: /metrics/counter_rates/some.complete.name.space

Note: If you set tokens in your statsd configuration file, then you need to authenticate your session by appending the token as query parameter like this: /stats?token=your_token_value. The default session expiration time is 1 hour.

Graphing

The library currently uses plotly to graph the stats. It can often lag when handling large data sets, though I consider this to be a reasonable trade-off due to its robust set of features.

Example Graph

Sample Graph

Contributors

  • Submit an issue citing the feature request first before submitting a PR
  • PRs offering different graphing libraries are encouraged :deciduous_tree:
  • Follow the coding style. Use ramda/sanctuary to write small generic functions with corresponding mocha tests. The functions should be composed in a point-free style whenever possible/practical for the DSL

License

Licensed under the MIT license