@Test void testJson() { JsonObjectBuilder builder = Json.createObjectBuilder(); dataSetTimer.jsonData(builder, dataSetTimerID); JsonObject json = builder.build(); JsonObject metricData = json.getJsonObject("response_time"); assertThat(metricData, notNullValue()); assertThat("count", metricData.getJsonNumber("count").longValue(), is(200L)); assertThat("elapsedTime", metricData.getJsonNumber("elapsedTime"), notNullValue()); }
@Override public void jsonData(JsonObjectBuilder builder, MetricID metricID) { JsonObjectBuilder myBuilder = JSON.createObjectBuilder() .add(jsonFullKey("count", metricID), getCount()) .add(jsonFullKey("elapsedTime", metricID), elapsedTimeInSeconds()); builder.add(metricID.getName(), myBuilder); }
HelidonSimpleTimer extends MetricImpl implements SimpleTimer { @Override public void jsonData(JsonObjectBuilder builder, MetricID metricID) { JsonObjectBuilder myBuilder = JSON.createObjectBuilder() .add(jsonFullKey("count", metricID), getCount()) .add(jsonFullKey("elapsedTime", metricID), elapsedTimeInSeconds()); builder.add(metricID.getName(), myBuilder); } }
HelidonSimpleTimer extends MetricImpl implements SimpleTimer { @Override public void jsonData(JsonObjectBuilder builder, MetricID metricID) { JsonObjectBuilder myBuilder = JSON.createObjectBuilder() .add(jsonFullKey("count", metricID), getCount()) .add(jsonFullKey("elapsedTime", metricID), elapsedTimeInSeconds()); builder.add(metricID.getName(), myBuilder); } private  HelidonSimpleTimer(String type, Metadata metadata, SimpleTimer delegate); }
HelidonSimpleTimer extends MetricImpl implements SimpleTimer { @Override public void jsonData(JsonObjectBuilder builder, MetricID metricID) { JsonObjectBuilder myBuilder = JSON.createObjectBuilder() .add(jsonFullKey("count", metricID), getCount()) .add(jsonFullKey("elapsedTime", metricID), elapsedTimeInSeconds()); builder.add(metricID.getName(), myBuilder); } private  HelidonSimpleTimer(String type, Metadata metadata, SimpleTimer delegate); @Override void update(Duration duration); @Override T time(Callable<T> event); @Override void time(Runnable event); @Override Context time(); @Override long getCount(); @Override Duration getElapsedTime(); @Override void prometheusData(StringBuilder sb, MetricID metricID, boolean withHelpType); @Override String prometheusValue(); @Override void jsonData(JsonObjectBuilder builder, MetricID metricID); @Override boolean equals(Object o); @Override int hashCode(); }
HelidonSimpleTimer extends MetricImpl implements SimpleTimer { @Override public void jsonData(JsonObjectBuilder builder, MetricID metricID) { JsonObjectBuilder myBuilder = JSON.createObjectBuilder() .add(jsonFullKey("count", metricID), getCount()) .add(jsonFullKey("elapsedTime", metricID), elapsedTimeInSeconds()); builder.add(metricID.getName(), myBuilder); } private  HelidonSimpleTimer(String type, Metadata metadata, SimpleTimer delegate); @Override void update(Duration duration); @Override T time(Callable<T> event); @Override void time(Runnable event); @Override Context time(); @Override long getCount(); @Override Duration getElapsedTime(); @Override void prometheusData(StringBuilder sb, MetricID metricID, boolean withHelpType); @Override String prometheusValue(); @Override void jsonData(JsonObjectBuilder builder, MetricID metricID); @Override boolean equals(Object o); @Override int hashCode();  }