diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/ProfilingUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/ProfilingUtils.java index 991c7680b478..4660a3500b25 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/ProfilingUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/ProfilingUtils.java @@ -28,6 +28,10 @@ public static void dump() { getInstance().dumpToLog(); } + public static void stop() { + getInstance().reset(null); + } + private static ProfilingUtils getInstance() { if (sInstance == null) { sInstance = new ProfilingUtils(); @@ -56,12 +60,18 @@ public void reset() { } public void addSplit(String splitLabel) { + if (mLabel == null) { + return; + } long now = SystemClock.elapsedRealtime(); mSplits.add(now); mSplitLabels.add(splitLabel); } public void dumpToLog() { + if (mLabel == null) { + return; + } AppLog.d(T.PROFILING, mLabel + ": begin"); final long first = mSplits.get(0); long now = first;