From 5049459bbcd4824094020394bff49497815ee69f Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Thu, 17 May 2018 17:09:53 +0200 Subject: [PATCH] default metric name after error --- src/main/java/perfix/MethodInvocation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/perfix/MethodInvocation.java b/src/main/java/perfix/MethodInvocation.java index c1fa759..64a8055 100644 --- a/src/main/java/perfix/MethodInvocation.java +++ b/src/main/java/perfix/MethodInvocation.java @@ -7,12 +7,17 @@ public class MethodInvocation { private MethodInvocation(String name) { t0 = System.nanoTime(); - this.name = name; + if (name != null) { + this.name = name; + } else { + this.name = ""; + } } public static MethodInvocation start(String name) { return new MethodInvocation(name); } + public static void stop(MethodInvocation methodInvocation) { methodInvocation.stop(); }