#1685 - Add support for MetaCounterMetrics and refactor DefaultServerCache to use them

This commit is contained in:
rob bygrave
2019-04-27 00:34:45 +12:00
parent d3ead5d2f9
commit 25e6d05542
31 changed files with 449 additions and 235 deletions
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.profile;
import io.ebean.ProfileLocation;
import io.ebean.meta.MetricType;
import io.ebean.metric.CountMetric;
import io.ebean.metric.MetricFactory;
import io.ebean.metric.QueryPlanMetric;
import io.ebean.metric.TimedMetric;
@@ -22,6 +23,11 @@ public class DMetricFactory implements MetricFactory {
return new DTimedMetric(metricType, name);
}
@Override
public CountMetric createCountMetric(MetricType metricType, String name) {
return new DCountMetric(metricType, name);
}
@Override
public QueryPlanMetric createQueryPlanMetric(MetricType metricType, Class<?> type, String label, ProfileLocation profileLocation, String sql) {
return new DQueryPlanMetric(new DQueryPlanMeta(type, label, profileLocation, sql), new DTimedMetric(metricType, label));