Bug 1331915 Add Telemetry probe to Graphite library usage draft
authorTom Ritter <tom@mozilla.com>
Fri, 28 Apr 2017 01:33:04 -0500
changeset 569963 ea0edac0e7c24d827d33ba616e1c644941becec3
parent 568807 a477e80f03b61be9961bc61770a2b55cce139b91
child 626356 7e2100271a0ca87622355eb130c91286cbe71e10
push id56343
push userbmo:tom@mozilla.com
push dateFri, 28 Apr 2017 06:33:32 +0000
bugs1331915
milestone55.0a1
Bug 1331915 Add Telemetry probe to Graphite library usage MozReview-Commit-ID: 1aU5ddQoLnV
gfx/thebes/gfxFont.cpp
toolkit/components/telemetry/Scalars.yaml
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2707,16 +2707,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, aRounding,
                                             aShapedText);
         }
     }
 
     if (!ok) {
--- 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.