Bug 1357207 - Caching duration recorded to telemetry should be milli-second . r?francois
In
Bug 1311935, We change positive/negative cache duration from milli-second to second.
But the value doesn't covert back to milli-second when store to telemetry(telemetry use
milli-second).
MozReview-Commit-ID: KR6xn9pwhUd
--- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
@@ -454,34 +454,34 @@ nsUrlClassifierUtils::ParseFindFullHashR
for (auto& m : r.matches()) {
nsCString tableNames;
nsresult rv = ConvertThreatTypeToListNames(m.threat_type(), tableNames);
if (NS_FAILED(rv)) {
hasUnknownThreatType = true;
continue; // Ignore un-convertable threat type.
}
auto& hash = m.threat().hash();
- auto cacheDuration = m.cache_duration().seconds();
+ auto cacheDurationSec = m.cache_duration().seconds();
aCallback->OnCompleteHashFound(nsCString(hash.c_str(), hash.length()),
- tableNames, cacheDuration);
+ tableNames, cacheDurationSec);
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_POSITIVE_CACHE_DURATION,
- cacheDuration);
+ cacheDurationSec * PR_MSEC_PER_SEC);
}
auto minWaitDuration = DurationToMs(r.minimum_wait_duration());
- auto negCacheDuration = r.negative_cache_duration().seconds();
+ auto negCacheDurationSec = r.negative_cache_duration().seconds();
- aCallback->OnResponseParsed(minWaitDuration, negCacheDuration);
+ aCallback->OnResponseParsed(minWaitDuration, negCacheDurationSec);
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_COMPLETION_ERROR,
hasUnknownThreatType ? UNKNOWN_THREAT_TYPE : SUCCESS);
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_NEGATIVE_CACHE_DURATION,
- negCacheDuration);
+ negCacheDurationSec * PR_MSEC_PER_SEC);
return NS_OK;
}
//////////////////////////////////////////////////////////
// nsIObserver
NS_IMETHODIMP