Bug 1311910 - Add telemetry to measure update error and update timeout rate for V2 and V4. r=francois,henry

MozReview-Commit-ID: JL4aZrUOGH7
This commit is contained in:
DimiL
2016-12-19 09:43:02 +08:00
parent f9b2d6a99d
commit 3cb66c6aee
7 changed files with 56 additions and 35 deletions

View File

@@ -606,6 +606,22 @@ nsUrlClassifierDBServiceWorker::FinishUpdate()
"ApplyUpdate() since the update has already failed."));
}
nsCOMPtr<nsIUrlClassifierUtils> urlUtil =
do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID);
nsCString provider;
// Assume that all the tables in update should have the same provider.
urlUtil->GetTelemetryProvider(mUpdateTables.SafeElementAt(0, EmptyCString()), provider);
nsresult updateStatus = mUpdateStatus;
if (NS_FAILED(mUpdateStatus)) {
updateStatus = NS_ERROR_GET_MODULE(mUpdateStatus) == NS_ERROR_MODULE_URL_CLASSIFIER ?
mUpdateStatus : NS_ERROR_UC_UPDATE_UNKNOWN;
}
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR, provider,
NS_ERROR_GET_CODE(updateStatus));
mMissCache.Clear();
if (NS_SUCCEEDED(mUpdateStatus)) {