if (source != null && !source.isEmpty()) {
g.writeStringField("source", source);
}
g.writeNumberField("measure_time", counter.getEpoch(TimeUnit.SECONDS));
if (counter.getValue() instanceof Integer) {
g.writeNumberField("value", (Integer) counter.getValue());
} else if (counter.getValue() instanceof Long) {
g.writeNumberField("value", (Long) counter.getValue());
} else if (counter.getValue() instanceof Float) {
g.writeNumberField("value", (Float) counter.getValue());
} else if (counter.getValue() instanceof Double) {