Bug 1362187 - mathml.doc_count scalar telemetry - r?tjr,francois draft
authorGerald Squelart <gsquelart@mozilla.com>
Wed, 25 Oct 2017 14:42:35 +1100
changeset 685864 641acd888c5d34b0f38c080bfd9f9ee641bdab5e
parent 685608 a124f4901430f6db74cfc7fe3b07957a1c691b40
child 737236 01d053fc838058d807dbaa53805037dca90f862c
push id86024
push usergsquelart@mozilla.com
push dateWed, 25 Oct 2017 03:47:20 +0000
reviewerstjr, francois
bugs1362187
milestone58.0a1
Bug 1362187 - mathml.doc_count scalar telemetry - r?tjr,francois Every time a document is destroyed, we record whether MathML was enabled, which is set to true when a MathML element was bound to the document. 'mathml.doc_count' will report how many such documents existed during a session. It should be compared to MIXED_CONTENT_PAGE_LOAD, which counts the total number of all page loads. MozReview-Commit-ID: Euf1apT2LhC
dom/base/nsDocument.cpp
toolkit/components/telemetry/Scalars.yaml
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1766,16 +1766,20 @@ nsDocument::~nsDocument()
         Accumulate(Telemetry::CSP_REFERRER_DIRECTIVE, mHasReferrerPolicyCSP);
       }
       if (mHasUnsafeInlineCSP) {
         Accumulate(Telemetry::CSP_UNSAFE_INLINE_DOCUMENTS_COUNT, 1);
       }
       if (mHasUnsafeEvalCSP) {
         Accumulate(Telemetry::CSP_UNSAFE_EVAL_DOCUMENTS_COUNT, 1);
       }
+
+      if (MOZ_UNLIKELY(GetMathMLEnabled())) {
+        ScalarAdd(Telemetry::ScalarID::MATHML_DOC_COUNT, 1);
+      }
     }
   }
 
   ReportUseCounters();
 
   mInDestructor = true;
   mInUnlinkOrDeletion = true;
 
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -702,16 +702,30 @@ webrtc.nicer:
     kind: uint
     notification_emails:
       - webrtc-ice-telemetry-alerts@mozilla.com
     release_channel_collection: opt-in
     record_in_processes:
       - 'main'
       - 'content'
 
+mathml:
+  doc_count:
+    bug_numbers:
+      - 1362187
+    description: >
+      The number of documents that contained enabled MathML elements.
+    expires: "63"
+    kind: uint
+    notification_emails:
+      - gsquelart@mozilla.com
+    release_channel_collection: opt-in
+    record_in_processes:
+      - 'content'
+
 mediarecorder:
   recording_count:
     bug_numbers:
       - 1400757
     description: >
       The number of times a MediaRecorder has been started. Recorded when a MediaRecorder starts
     expires: "60"
     kind: uint