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.
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
andtype
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.