ENH: Add ProfileLocation - Part 2 - performance metrics for transactions with label and profileLocation

This commit is contained in:
Rob Bygrave committed 2018-01-22 14:54:27 +13:00
1 parent 4e33027fdf
commit 51d2e4c600
37 files changed
+779 -33

No files matched your search

@@ -2,6 +2,8 @@ package io.ebeaninternal.server.profile;
import io.ebean.ProfileLocation;
import io.ebean.service.SpiProfileLocationFactory;
import io.ebeaninternal.metric.MetricFactory;
import io.ebeaninternal.metric.TimedMetric;
/**
* Default implementation of the profile location factory.
@@ -14,12 +16,17 @@ public class DProfileLocationFactory implements SpiProfileLocationFactory {
}
@Override
public ProfileLocation create(int lineNumber) {
return new DProfileLocation(lineNumber);
public ProfileLocation create(int lineNumber, String label) {
TimedMetric timedMetric = MetricFactory.get().createTimedMetric("txn.named." + label);
DTimedProfileLocation loc = new DTimedProfileLocation(lineNumber, label, timedMetric);
TimedProfileLocationRegistry.register(loc);
return loc;
}
@Override
public ProfileLocation create(String location) {
public ProfileLocation createAt(String location) {
return new BasicProfileLocation(location);
}
}