mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 723924 - Telemetry for time needed for a single frecency update.
r=dietrich
This commit is contained in:
parent
143e82564e
commit
a1be08b67e
@ -51,6 +51,8 @@
|
||||
#if defined(XP_OS2)
|
||||
#include "nsIRandomGenerator.h"
|
||||
#endif
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
using namespace mozilla::storage;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -467,6 +469,8 @@ namespace places {
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ASSERTION(numEntries > 0, "unexpected number of arguments");
|
||||
|
||||
Telemetry::AutoTimer<Telemetry::PLACES_FRECENCY_CALC_TIME_MS> timer;
|
||||
|
||||
PRInt64 pageId = aArguments->AsInt64(0);
|
||||
PRInt32 typed = numEntries > 1 ? aArguments->AsInt32(1) : 0;
|
||||
PRInt32 fullVisitCount = numEntries > 2 ? aArguments->AsInt32(2) : 0;
|
||||
|
@ -26,6 +26,7 @@ let histograms = {
|
||||
PLACES_ANNOS_BOOKMARKS_SIZE_KB: function (val) do_check_eq(val, 1),
|
||||
PLACES_ANNOS_PAGES_COUNT: function (val) do_check_eq(val, 1),
|
||||
PLACES_ANNOS_PAGES_SIZE_KB: function (val) do_check_eq(val, 1),
|
||||
PLACES_FRECENCY_CALC_TIME_MS: function (val) do_check_true(val >= 0),
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
@ -126,7 +127,9 @@ function check_telemetry() {
|
||||
for (let histogramId in histograms) {
|
||||
do_log_info("checking histogram " + histogramId);
|
||||
let validate = histograms[histogramId];
|
||||
validate(Services.telemetry.getHistogramById(histogramId).snapshot().sum);
|
||||
let snapshot = Services.telemetry.getHistogramById(histogramId).snapshot();
|
||||
validate(snapshot.sum);
|
||||
do_check_true(snapshot.counts.reduce(function(a, b) a + b) > 0);
|
||||
}
|
||||
do_test_finished();
|
||||
}
|
||||
|
@ -293,6 +293,7 @@ HISTOGRAM(PLACES_ANNOS_BOOKMARKS_COUNT, 50, 5000, 10, EXPONENTIAL, "PLACES: Numb
|
||||
HISTOGRAM(PLACES_ANNOS_BOOKMARKS_SIZE_KB, 10, 10000, 10, EXPONENTIAL, "PLACES: Size of bookmarks annotations (KB)")
|
||||
HISTOGRAM(PLACES_ANNOS_PAGES_COUNT, 50, 5000, 10, EXPONENTIAL, "PLACES: Number of pages annotations")
|
||||
HISTOGRAM(PLACES_ANNOS_PAGES_SIZE_KB, 10, 10000, 10, EXPONENTIAL, "PLACES: Size of pages annotations (KB)")
|
||||
HISTOGRAM(PLACES_FRECENCY_CALC_TIME_MS, 1, 100, 10, EXPONENTIAL, "PLACES: Time to calculate frecency of a page (ms)")
|
||||
|
||||
/**
|
||||
* Updater telemetry.
|
||||
|
Loading…
Reference in New Issue
Block a user