Giter Site home page Giter Site logo

statsdedupe's Introduction

StatsDedupe

A backend for statsd that aggregates and ages out set data based on arbitrary time limits

The syntax for the expiration of a set value is

key:value|s|#age OR key:value|s|@sampe-rate|#age

e.g. active_users:joe-bob|s|#1m

This backend collects all set data which it deduplicates just like a normal set metric. The backend then keeps each value in the set for the specified amount of time (see notation above). Every flush interval it then reports the size of each set as a gague to a given list of backends (it's parent statsd server by default).

Aging Specifics

The set data is kept for the amount of time specified by the most recent packet so if you need to expire a key immediately you can just send out key:value|s|#0

Valid units on the end of the expiration are

  • Milliseconds - ms (default)
  • Seconds - s
  • Minutes - m
  • Hours - h
  • Days - d

Warning: Having the same key sent with different expirations is probably not what you want. This will lead to metrics which are harder to interperet.

Configuration

The statsdedupe key can take the following keys

realtime: <bool> (default false) this specifies weather a packet should be sent out immediately when a new key is added to a set or if it's alright to wait until the flush interval. If this is false then set sizes timestamps will be skewed right by about 1 flush interval

hosts: [{host: <address>, port: <port>},...] (defaults to parent statsd) this specifies the statsd hosts statsdedupe should send data to.

Also see the example config

Output

Each set size is output as a simple gague with the same key name as the set key:set_size|g

Installation

  • Put statsdedupe.js into your backend folder for statsd and priority_queue.js in your statsd library directory

  • Configure the statsdedupe backend

  • Start the statsd daemon:

    node stats.js /path/to/config

Thanks

This project was largely inspired by the Gossip Girl backend and uses priority queue code from Daniel Moore

Thanks to the folks at etsy for statsd

statsdedupe's People

Contributors

mbish avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.