rosskukulinski / lynx-express

Express Middleware for sending data to StatsD
MIT License
11 stars 6 forks source link

Feature Request: Batching metrics before sending to statsd #3

Open ankitjaininfo opened 9 years ago

ankitjaininfo commented 9 years ago

Possibly buffering collected request metrics and flushing every 2 seconds.

ankitjaininfo commented 9 years ago

If not buffering, at minimum statsd's feature to batch multiple calls should be done.

Here is an example:

client.send(
  { "foo" : "-1|c"    // count
  , "bar" : "15|g"    // gauge
  , "baz" : "500|ms"  // timing
  , "boaz": "40|s"    // set
  }, 0.1);            // sample rate at `0.1`
rosskukulinski commented 9 years ago

Hello @ankitjaininfo. I'm curious: are you running into performance problems in Node? With Graphite? I'm not opposed to optimizing, but don't want to do so prematurely :)

gs-ajain commented 9 years ago

No, did not ran into performance, my project has less traffic today. I can send you PR when I attempt it. This is just a enhancement request.

rosskukulinski commented 9 years ago

Alright. I know that Lynx has support for batching, so hopefully it wouldn't be too much work to add that in.