for (Result result : results) {
Map<String, Object> resultValues = result.getValues();
if (resultValues != null) {
for (Map.Entry<String, Object> values : resultValues.entrySet()) {
if (NumberUtils.isNumeric(values.getValue())) {
g.writeStartObject();
g.writeStringField("name", KeyUtils.getKeyStringWithDottedKeys(query, result, values, typeNames));
if (source != null && !source.isEmpty()) {
g.writeStringField("source", source);
}
g.writeNumberField("measure_time", TimeUnit.SECONDS.convert(result.getEpoch(), TimeUnit.MILLISECONDS));