mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1586 - ENH: Add TimedMetric.addSinceNanos() ... as a helper when using start nanos
This commit is contained in:
@@ -24,6 +24,11 @@ class DTimedMetricMap implements TimedMetricMap {
|
||||
add(key, (System.nanoTime() - startNanos)/1000L);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSinceNanos(String key, long startNanos, int beans) {
|
||||
add(key, (System.nanoTime() - startNanos)/1000L, beans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(String key, long exeMicros) {
|
||||
map.computeIfAbsent(key, (k) -> new DTimedMetric(metricType, name + key)).add(exeMicros);
|
||||
|
||||
Reference in New Issue
Block a user