From 00349527e136f7f96502d0f61f5aaeceb8617e34 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 28 Oct 2018 11:47:12 +0100 Subject: [PATCH] calculate IobCobThread execution time --- .../androidaps/plugins/IobCobCalculator/IobCobOref1Thread.java | 3 +++ .../androidaps/plugins/IobCobCalculator/IobCobThread.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobOref1Thread.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobOref1Thread.java index 049fb031bc..97de1927a7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobOref1Thread.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobOref1Thread.java @@ -38,6 +38,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.FabricPrivacy; +import info.nightscout.utils.Profiler; import info.nightscout.utils.SP; import static info.nightscout.utils.DateUtil.now; @@ -75,6 +76,7 @@ public class IobCobOref1Thread extends Thread { @Override public final void run() { + long start = DateUtil.now(); mWakeLock.acquire(); try { if (L.isEnabled(L.AUTOSENS)) @@ -395,6 +397,7 @@ public class IobCobOref1Thread extends Thread { MainApp.bus().post(new EventIobCalculationProgress("")); if (L.isEnabled(L.AUTOSENS)) log.debug("AUTOSENSDATA thread ended: " + from); + Profiler.log(log, "IobCobOref1Thread", start); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java index 7229532446..80aaf9450c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java @@ -38,6 +38,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.FabricPrivacy; +import info.nightscout.utils.Profiler; import info.nightscout.utils.SP; import static info.nightscout.utils.DateUtil.now; @@ -74,6 +75,7 @@ public class IobCobThread extends Thread { @Override public final void run() { + long start = DateUtil.now(); mWakeLock.acquire(); try { if (L.isEnabled(L.AUTOSENS)) @@ -322,6 +324,7 @@ public class IobCobThread extends Thread { MainApp.bus().post(new EventIobCalculationProgress("")); if (L.isEnabled(L.AUTOSENS)) log.debug("AUTOSENSDATA thread ended: " + from); + Profiler.log(log, "IobCobThread", start); } }