Bug 721019 - [Page Thumbnails] Add telemetry probes; r=dietrich

This commit is contained in:
Tim Taubert 2012-02-02 15:50:53 +01:00
Родитель b0fd45b673
Коммит 1c8a23951a
3 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -77,6 +77,7 @@ let PageThumbs = {
* @return The newly created canvas containing the image data.
*/
capture: function PageThumbs_capture(aWindow) {
let telemetryCaptureTime = new Date();
let [sw, sh, scale] = this._determineCropSize(aWindow);
let canvas = this._createCanvas();
@ -93,6 +94,9 @@ let PageThumbs = {
// We couldn't draw to the canvas for some reason.
}
Services.telemetry.getHistogramById("FX_THUMBNAILS_CAPTURE_TIME_MS")
.add(new Date() - telemetryCaptureTime);
return canvas;
},
@ -105,13 +109,20 @@ let PageThumbs = {
* stored (optional).
*/
store: function PageThumbs_store(aKey, aCanvas, aCallback) {
let self = this;
let telemetryStoreTime = new Date();
function finish(aSuccessful) {
if (aSuccessful) {
Services.telemetry.getHistogramById("FX_THUMBNAILS_STORE_TIME_MS")
.add(new Date() - telemetryStoreTime);
}
if (aCallback)
aCallback(aSuccessful);
}
let self = this;
// Get a writeable cache entry.
PageThumbsCache.getWriteEntry(aKey, function (aEntry) {
if (!aEntry) {

Просмотреть файл

@ -129,12 +129,18 @@ Channel.prototype = {
// Try to read the data from the thumbnail cache.
this._readCache(function (aData) {
let telemetryThumbnailFound = true;
// Update response if there's no data.
if (!aData) {
this._responseStatus = 404;
this._responseText = "Not Found";
telemetryThumbnailFound = false;
}
Services.telemetry.getHistogramById("FX_THUMBNAILS_HIT_OR_MISS")
.add(telemetryThumbnailFound);
this._startRequest();
if (!this.canceled) {

Просмотреть файл

@ -313,6 +313,13 @@ HISTOGRAM(FX_TAB_ANIM_OPEN_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by
HISTOGRAM(FX_TAB_ANIM_CLOSE_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab closing animation in milliseconds")
HISTOGRAM_BOOLEAN(FX_CONTEXT_SEARCH_AND_TAB_SELECT, "Firefox: Background tab was selected within 5 seconds of searching from the context menu")
HISTOGRAM(FX_IDENTITY_POPUP_OPEN_MS, 1, 1000, 10, EXPONENTIAL, "Firefox: Time taken by the identity popup to open in milliseconds")
/**
* Thumbnail Service telemetry.
*/
HISTOGRAM(FX_THUMBNAILS_CAPTURE_TIME_MS, 1, 500, 15, EXPONENTIAL, "THUMBNAILS: Time (ms) it takes to capture a thumbnail")
HISTOGRAM(FX_THUMBNAILS_STORE_TIME_MS, 1, 500, 15, EXPONENTIAL, "THUMBNAILS: Time (ms) it takes to store a thumbnail in the cache")
HISTOGRAM(FX_THUMBNAILS_HIT_OR_MISS, 0, 1, 2, BOOLEAN, "THUMBNAILS: Thumbnail found")
// #endif
HISTOGRAM_BOOLEAN(INNERWINDOWS_WITH_MUTATION_LISTENERS, "Deleted or to-be-reused innerwindow which has had mutation event listeners.")