default metric name after error
This commit is contained in:
parent
138418cada
commit
5049459bbc
1 changed files with 6 additions and 1 deletions
|
|
@ -7,12 +7,17 @@ public class MethodInvocation {
|
||||||
|
|
||||||
private MethodInvocation(String name) {
|
private MethodInvocation(String name) {
|
||||||
t0 = System.nanoTime();
|
t0 = System.nanoTime();
|
||||||
this.name = name;
|
if (name != null) {
|
||||||
|
this.name = name;
|
||||||
|
} else {
|
||||||
|
this.name = "<UNKNOWN_BECAUSE_OF_ERROR>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MethodInvocation start(String name) {
|
public static MethodInvocation start(String name) {
|
||||||
return new MethodInvocation(name);
|
return new MethodInvocation(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void stop(MethodInvocation methodInvocation) {
|
public static void stop(MethodInvocation methodInvocation) {
|
||||||
methodInvocation.stop();
|
methodInvocation.stop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue