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 361083 2a37df0fa9c2
parent 361082 35c323e749d5
child 361084 a2340b08f4f7
push id90784
push usercbook@mozilla.com
push dateMon, 29 May 2017 09:35:20 +0000
treeherdermozilla-inbound@4340666eb8e0 [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);