yaorg / node-measured

A Node metrics library for measuring and reporting application-level metrics, inspired by Coda Hale, Yammer Inc's Dropwizard Metrics Libraries
https://yaorg.github.io/node-measured/
MIT License
517 stars 52 forks source link

toFlatJSON(): My attempt at what I think is meant by the flatten() feature for reporters #20

Closed reaandrew closed 8 years ago

reaandrew commented 8 years ago

I wanted to have an output of the JSON in such a way that I could search over it meaning I would need properties like name and type as opposed to each of the metrics being keyed by the name of the metric e.g. requestsPerSecond. This will help me getting the output into elastic search and the like too.

This feels like the intended functionality for the flatten() method mentioned in the todos in the README but I could be wrong. Not 100% sure about the name (toFlatJSON). I did think about a method which is called flatten which would take the original output of toJSON but this is the implementation I have gone with for now.

reaandrew commented 8 years ago

I just found your elastic search reporter. I will close this pull request.

mantoni commented 8 years ago

:+1: