Bug 1334616 - Add telemetry probe to monitor ClassifyLocalWithTables() perf. r=gcp
☠☠ backed out by 6db058fe1d63 ☠ ☠
authorFrancois Marier <francois@mozilla.com>
Fri, 03 Feb 2017 20:56:05 +0800
changeset 479908 2e9eab35d1ea435da4b0a8438035b1ce614a1a6f
parent 479907 28f5dd10784202d1fb9b31548df0909eba8c25e6
child 479909 6db058fe1d63d9f4d8dc5ecc7b77b0330abc96dd
push id44393
push userVYV03354@nifty.ne.jp
push dateTue, 07 Feb 2017 13:53:48 +0000
reviewersgcp
bugs1334616
milestone54.0a1
Bug 1334616 - Add telemetry probe to monitor ClassifyLocalWithTables() perf. r=gcp MozReview-Commit-ID: LfKovwAX9Ov
toolkit/components/telemetry/Histograms.json
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3978,16 +3978,24 @@
     "keyed": true,
     "kind": "exponential",
     "low": 20,
     "high": 120000,
     "n_buckets": 30,
     "bug_numbers": [1315893],
     "description": "Time spent per classifier update (ms), keyed by the name of the provider."
   },
+  "URLCLASSIFIER_CLASSIFYLOCAL_TIME": {
+    "alert_emails": ["safebrowsing-telemetry@mozilla.org"],
+    "expires_in_version": "never",
+    "kind": "exponential",
+    "high": 60000,
+    "n_buckets": 30,
+    "description": "Time spent inside ClassifyLocalWithTables (ms)"
+  },
   "URLCLASSIFIER_PS_FILELOAD_TIME": {
     "alert_emails": ["safebrowsing-telemetry@mozilla.org"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 1000,
     "n_buckets": 10,
     "description": "Time spent loading PrefixSet from file (ms)"
   },
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -1562,16 +1562,17 @@ nsUrlClassifierDBService::ClassifyLocalW
                                                                   &aTableResults);
     if (result) {
       return rv;
     }
     return NS_ERROR_FAILURE;
   }
 
   PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
+  Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_CLASSIFYLOCAL_TIME> timer;
 
   nsCOMPtr<nsIURI> uri = NS_GetInnermostURI(aURI);
   NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);
 
   nsAutoCString key;
   // Canonicalize the url
   nsCOMPtr<nsIUrlClassifierUtils> utilsService =
     do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID);