mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Remove io.ebean.meta.MetricType as it is unnecessary (#1923)
This commit is contained in:
@@ -5,7 +5,6 @@ import io.ebean.annotation.Platform;
|
||||
import io.ebean.cache.ServerCacheStatistics;
|
||||
import io.ebean.config.dbplatform.IdType;
|
||||
import io.ebean.meta.MetaTimedMetric;
|
||||
import io.ebean.meta.MetricType;
|
||||
import io.ebean.meta.ServerMetrics;
|
||||
import io.ebean.util.StringHelper;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
@@ -98,7 +97,7 @@ public abstract class BaseTestCase {
|
||||
List<MetaTimedMetric> timedMetrics = visitTimedMetrics();
|
||||
|
||||
return timedMetrics.stream()
|
||||
.filter((it) -> it.getMetricType() == MetricType.SQL)
|
||||
.filter((it) -> it.getName().startsWith("sql.") || it.getName().startsWith("orm."))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package io.ebeaninternal.server.deploy;
|
||||
|
||||
import io.ebean.meta.BasicMetricVisitor;
|
||||
import io.ebean.meta.MetaTimedMetric;
|
||||
import io.ebean.meta.MetricType;
|
||||
import io.ebeaninternal.server.core.PersistRequest;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -29,7 +28,6 @@ public class BeanIudMetricsTest {
|
||||
|
||||
assertThat(timed.get(0).getCount()).isEqualTo(4);
|
||||
assertThat(timed.get(0).getName()).isEqualTo("iud.one.insertBatch");
|
||||
assertThat(timed.get(0).getMetricType()).isEqualTo(MetricType.IUD);
|
||||
|
||||
iudMetrics.addBatch(PersistRequest.Type.UPDATE, startNanos, 1);
|
||||
iudMetrics.addBatch(PersistRequest.Type.DELETE_SOFT, startNanos, 2);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.ebeaninternal.server.profile;
|
||||
|
||||
import io.ebean.meta.MetricType;
|
||||
import io.ebean.metric.MetricFactory;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -11,7 +10,7 @@ public class BasicProfileLocationTest {
|
||||
@Test
|
||||
public void obtain() {
|
||||
|
||||
DProfileLocation loc = new DTimedProfileLocation(12, "foo", MetricFactory.get().createTimedMetric(MetricType.TXN, "junk"));
|
||||
DProfileLocation loc = new DTimedProfileLocation(12, "foo", MetricFactory.get().createTimedMetric("junk"));
|
||||
|
||||
assertThat(loc.obtain()).isTrue();
|
||||
assertThat(loc.fullLocation()).endsWith(":12)");
|
||||
|
||||
@@ -2,7 +2,6 @@ package io.ebeaninternal.server.profile;
|
||||
|
||||
import io.ebean.meta.BasicMetricVisitor;
|
||||
import io.ebean.meta.MetaTimedMetric;
|
||||
import io.ebean.meta.MetricType;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -12,7 +11,7 @@ public class DTimedMetricMapTest {
|
||||
@Test
|
||||
public void addSinceNanos() throws InterruptedException {
|
||||
|
||||
DTimedMetricMap metricMap = new DTimedMetricMap(MetricType.L2, "addSinceNanos");
|
||||
DTimedMetricMap metricMap = new DTimedMetricMap("addSinceNanos");
|
||||
|
||||
long nanos = System.nanoTime();
|
||||
Thread.sleep(10);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.ebeaninternal.server.profile;
|
||||
|
||||
import io.ebean.meta.MetricType;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -10,7 +9,7 @@ public class DTimedMetricTest {
|
||||
@Test
|
||||
public void addSinceNanos() throws InterruptedException {
|
||||
|
||||
DTimedMetric metric = new DTimedMetric(MetricType.L2, "addSinceNanos");
|
||||
DTimedMetric metric = new DTimedMetric("addSinceNanos");
|
||||
|
||||
long start = System.nanoTime();
|
||||
Thread.sleep(10);
|
||||
@@ -33,7 +32,7 @@ public class DTimedMetricTest {
|
||||
@Test
|
||||
public void addBatchSince() throws InterruptedException {
|
||||
|
||||
DTimedMetric metric = new DTimedMetric(MetricType.L2, "addSinceNanos");
|
||||
DTimedMetric metric = new DTimedMetric("addSinceNanos");
|
||||
|
||||
long start = System.nanoTime();
|
||||
Thread.sleep(10);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.ebeaninternal.server.profile;
|
||||
|
||||
import io.ebean.meta.MetaTimedMetric;
|
||||
import io.ebean.meta.MetricType;
|
||||
import io.ebean.meta.SortMetric;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -62,6 +61,6 @@ public class SortMetricTest {
|
||||
}
|
||||
|
||||
private DTimeMetricStats create(String name) {
|
||||
return new DTimeMetricStats(MetricType.L2, name, false, 0, 0, 0);
|
||||
return new DTimeMetricStats(name, false, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user