mac-/hapi-statsd

replace the cache with timing information on the request

5c077yP opened this issue · 5 comments

hey there,

i was just going through the code, because i want to use this plugin. I'm just wondering if there's a reason you're using a cache for keeping track of the request ids ? looking at the latest hapi api, each request contains already a timestamp for when it came into the system. So to get the startDate one can just use request.info.received, which would make this cache object obsolete, the code simpler and the memory-footprint lower. if you're confident with that i would like to add a PR for that.

mac- commented

I'm not sure if that property was available when I first build this module, but I agree - that sounds like a much better solution. I would accept a PR for that.

@catalint are you planning on finishing this feature, its something I would really like implemented and if you don't have the time, i'm more than willing to tackle it. I want to use this module for an upcoming project and really would like to lose that extra dependency, let me know!

actually, i have a long-standing PR for this https://github.com/mac-/hapi-statsd/pull/14 but still waiting for an answer there, also just realized @mac- merged another PR that actually broke mine ... :(

okay, i went ahead and did the work in case you didn't have time, so if you don't want to deal with it, I can just open a new PR, tests are already passing

@kkemple try a pr with mac- I've made a new module from my changes, my pr or this project does not seem to be on mac- 's radar and I want to log stuff to statsd