From a9e602f1f50828346ddd580ec809aeb2c387e83b Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Thu, 17 Sep 2015 11:18:52 +0200 Subject: [PATCH] update ProfilingUtils usage --- .../org/wordpress/android/util/ProfilingUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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;