Bug 1059390 - Part 3: Limit count only for new crash records in CrashStore._ensureCrashRecord. r=bsmedberg
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Fri, 29 Aug 2014 13:38:49 -0700
changeset 202517 26061d23f04085bd89f3cf0888ef4dd2fc787a47
parent 202516 3a84ff6e33070b6236cb92ff450ed3be69ec2892
child 202518 e24d5e087d3691148c64407af5b66d4208c86f4b
push id48423
push userbirunthan@mohanathas.com
push dateFri, 29 Aug 2014 20:40:20 +0000
treeherdermozilla-inbound@b97cbea6f8b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1059390
milestone34.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 1059390 - Part 3: Limit count only for new crash records in CrashStore._ensureCrashRecord. r=bsmedberg
toolkit/components/crashes/CrashManager.jsm
--- a/toolkit/components/crashes/CrashManager.jsm
+++ b/toolkit/components/crashes/CrashManager.jsm
@@ -1000,29 +1000,30 @@ CrashStore.prototype = Object.freeze({
    */
   _ensureCrashRecord: function (processType, crashType, id, date) {
     if (!id) {
       // Crashes are keyed on ID, so it's not really helpful to store crashes
       // without IDs.
       return null;
     }
 
-    let day = dateToDays(date);
-    this._ensureCountsForDay(day);
-
     let type = processType + "-" + crashType;
-    let count = (this._countsByDay.get(day).get(type) || 0) + 1;
-    this._countsByDay.get(day).set(type, count);
-
-    if (count > this.HIGH_WATER_DAILY_THRESHOLD &&
-        processType != CrashManager.prototype.PROCESS_TYPE_MAIN) {
-      return null;
-    }
 
     if (!this._data.crashes.has(id)) {
+      let day = dateToDays(date);
+      this._ensureCountsForDay(day);
+
+      let count = (this._countsByDay.get(day).get(type) || 0) + 1;
+      this._countsByDay.get(day).set(type, count);
+
+      if (count > this.HIGH_WATER_DAILY_THRESHOLD &&
+          processType != CrashManager.prototype.PROCESS_TYPE_MAIN) {
+        return null;
+      }
+
       this._data.crashes.set(id, {
         id: id,
         remoteID: null,
         type: type,
         crashDate: date,
         submissions: new Map(),
       });
     }