public void addValue(long value)
    {
        sum.addAndGet(value);
        count.incrementAndGet();
        max.accumulateAndGet(value, Math::max);
        min.accumulateAndGet(value, Math::min);
    }
@Test
    public void testJson()
    {
        JsonCodec<RuntimeMetric> codec = JsonCodec.jsonCodec(RuntimeMetric.class);
        RuntimeMetric metric = new RuntimeMetric(TEST_METRIC_NAME, NANO);
        metric.addValue(101);
        metric.addValue(202);

        String json = codec.toJson(metric);
        RuntimeMetric actual = codec.fromJson(json);

        assertRuntimeMetricEquals(actual, metric);
    }