Open dbader opened 8 years ago
Have you considered using https://github.com/circonus-labs/circllhist.js ?
Personally, I'd be in favor of a simple solution like dropping new/old samples if the buffer is full. Especially for a first implementation to plug the memory issue.
Under normal operation it should be quite rare we encounter this situation. For my use cases, it would be okay to drop samples.
https://github.com/dbader/node-datadog-metrics/blob/10d3b29d1fa527807e1301857caac400c54127b6/lib/metrics.js#L133-L136
If ddog is down this will hog a lot of memory.