Skip to content

Commit

Permalink
Bug 1135543 - Part 4: Define DailyCrashesMeasurement6 containing main…
Browse files Browse the repository at this point in the history
…-crash-oom; (Partial only, missing files in AF)
  • Loading branch information
rmottola committed Jul 4, 2019
1 parent 3aa7f0d commit ea64fac
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
33 changes: 33 additions & 0 deletions services/healthreport/docs/dataformat.rst
Expand Up @@ -1078,6 +1078,39 @@ org.mozilla.crashes.crashes
This measurement contains a historical record of application crashes.
Version 6
^^^^^^^^^
This version adds tracking for out-of-memory (OOM) crashes in the main process.
An OOM crash will be counted as both main-crash and main-crash-oom.
This measurement will be reported on each day there was a crash or crash
submission. Records may contain the following fields, whose values indicate
the number of crashes, hangs, or submissions that occurred on the given day:
* content-crash
* content-crash-submission-succeeded
* content-crash-submission-failed
* content-hang
* content-hang-submission-succeeded
* content-hang-submission-failed
* gmplugin-crash
* gmplugin-crash-submission-succeeded
* gmplugin-crash-submission-failed
* main-crash
* main-crash-oom
* main-crash-submission-succeeded
* main-crash-submission-failed
* main-hang
* main-hang-submission-succeeded
* main-hang-submission-failed
* plugin-crash
* plugin-crash-submission-succeeded
* plugin-crash-submission-failed
* plugin-hang
* plugin-hang-submission-succeeded
* plugin-hang-submission-failed
Version 5
^^^^^^^^^
Expand Down
17 changes: 17 additions & 0 deletions toolkit/components/crashes/CrashManager.jsm
Expand Up @@ -800,6 +800,15 @@ CrashStore.prototype = Object.freeze({

let key = dateToDays(denormalized.crashDate) + "-" + denormalized.type;
actualCounts.set(key, (actualCounts.get(key) || 0) + 1);

// If we have an OOM size, count the crash as an OOM in addition to
// being a main process crash.
if (denormalized.metadata &&
denormalized.metadata.OOMAllocationSize) {
let oomKey = key + "-oom";
actualCounts.set(oomKey, (actualCounts.get(oomKey) || 0) + 1);
}

}

if (hasSubmissionsStoredAsCrashes) {
Expand Down Expand Up @@ -1085,6 +1094,14 @@ CrashStore.prototype = Object.freeze({
return null;
}

// If we have an OOM size, count the crash as an OOM in addition to
// being a main process crash.
if (metadata && metadata.OOMAllocationSize) {
let oomType = type + "-oom";
let oomCount = (this._countsByDay.get(day).get(oomType) || 0) + 1;
this._countsByDay.get(day).set(oomType, oomCount);
}

this._data.crashes.set(id, {
id: id,
remoteID: null,
Expand Down

0 comments on commit ea64fac

Please sign in to comment.