Bug 1331915 - Add Telemetry probe to Graphite library usage. r=jfkthame, a=gchang
authorTom Ritter <tom@mozilla.com>
Fri, 28 Apr 2017 01:33:04 -0500
changeset 393857 0f9b796efd49f85906a9bea4d439e2cd34c6afe2
parent 393856 bf1dbe42eca073481652dfe13e59b8e0782a2109
child 393858 19b457181440eb5b844c2a8b5dfa2e97228d11b1
push id7281
push userryanvm@gmail.com
push dateSat, 06 May 2017 01:11:41 +0000
treeherdermozilla-beta@3d9699ce0b0a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, gchang
bugs1331915
milestone54.0
Bug 1331915 - Add Telemetry probe to Graphite library usage. r=jfkthame, a=gchang MozReview-Commit-ID: 1aU5ddQoLnV
gfx/thebes/gfxFont.cpp
toolkit/components/telemetry/Scalars.yaml
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2680,16 +2680,17 @@ gfxFont::ShapeText(DrawTarget      *aDra
     bool ok = false;
 
     // XXX Currently, we do all vertical shaping through harfbuzz.
     // Vertical graphite support may be wanted as a future enhancement.
     if (FontCanSupportGraphite() && !aVertical) {
         if (gfxPlatform::GetPlatform()->UseGraphiteShaping()) {
             if (!mGraphiteShaper) {
                 mGraphiteShaper = MakeUnique<gfxGraphiteShaper>(this);
+                Telemetry::ScalarAdd(Telemetry::ScalarID::BROWSER_USAGE_GRAPHITE, 1);
             }
             ok = mGraphiteShaper->ShapeText(aDrawTarget, aText, aOffset, aLength,
                                             aScript, aVertical, aShapedText);
         }
     }
 
     if (!ok) {
         if (!mHarfBuzzShaper) {
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -196,16 +196,31 @@ browser.engagement.navigation:
     kind: uint
     keyed: true
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
     record_in_processes:
       - 'main'
 
+# The following section contains the browser usage scalars.
+browser.usage:
+  graphite:
+    bug_numbers:
+      - 1331915
+    description: >
+      The number of times a graphite2 font has been loaded.
+    expires: "60"
+    kind: uint
+    notification_emails:
+      - tom@mozilla.com
+    release_channel_collection: opt-in
+    record_in_processes:
+      - 'all'
+
 # This section is for probes used to measure use of the Webextensions storage.sync API.
 storage.sync.api.usage:
   extensions_using:
     bug_numbers:
       - 1328974
     description: >
       The count of webextensions that have data stored in the chrome.storage.sync API.
       This includes extensions that have not used the storage.sync API this session.