Bug 1333624 - AutoTimer now asserts on empty histogram key names. r=billm
authorPaavini <paavininanda@gmail.com>
Thu, 25 May 2017 05:43:00 +0200
changeset 361182 2a37df0fa9c2
parent 361181 35c323e749d5
child 361183 a2340b08f4f7
push id31918
push usercbook@mozilla.com
push dateTue, 30 May 2017 09:39:11 +0000
treeherdermozilla-central@286f71223256 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1333624
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1333624 - AutoTimer now asserts on empty histogram key names. r=billm
toolkit/components/telemetry/Telemetry.h
--- a/toolkit/components/telemetry/Telemetry.h
+++ b/toolkit/components/telemetry/Telemetry.h
@@ -186,16 +186,17 @@ public:
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   }
 
   explicit AutoTimer(const nsCString& aKey, TimeStamp aStart = TimeStamp::Now() MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : start(aStart)
     , key(aKey)
   {
+    MOZ_ASSERT(!aKey.IsEmpty(), "The key must not be empty.");
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   }
 
   ~AutoTimer() {
     if (key.IsEmpty()) {
       AccumulateDelta_impl<res>::compute(id, start);
     } else {
       AccumulateDelta_impl<res>::compute(id, key, start);