Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: ui/file_manager/file_manager/background/js/media_import_handler.js

Issue 933553003: Files.app: Analytics tweaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/file_manager/file_manager/common/js/metrics_events.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/background/js/media_import_handler.js
diff --git a/ui/file_manager/file_manager/background/js/media_import_handler.js b/ui/file_manager/file_manager/background/js/media_import_handler.js
index 848de3884a24dbaba59e916d5ceaf00173d74fa6..6612b094d6b5f601a3bc0246685814ac89cad310 100644
--- a/ui/file_manager/file_manager/background/js/media_import_handler.js
+++ b/ui/file_manager/file_manager/background/js/media_import_handler.js
@@ -200,6 +200,9 @@ importer.MediaImportHandler.ImportTask = function(
/** @private {number} Number of files deduped by content dedupe. */
this.dedupeCount_ = 0;
+
+ /** @private {number} */
+ this.errorCount_ = 0;
};
/** @struct */
@@ -464,9 +467,7 @@ importer.MediaImportHandler.ImportTask.prototype.onSuccess_ = function() {
*/
importer.MediaImportHandler.ImportTask.prototype.onError_ = function(error) {
this.notify(importer.TaskQueue.UpdateType.ERROR);
- // TODO(kenobi): Impedence mismatch: this gets called per-file, which is
- // different from onSuccess, which reports overall import success.
- this.tracker_.send(metrics.ImportEvents.ERROR);
+ this.errorCount_++;
};
/**
@@ -483,6 +484,8 @@ importer.MediaImportHandler.ImportTask.prototype.sendImportStats_ = function() {
metrics.ImportEvents.FILE_COUNT
.value(importFileCount));
+ this.tracker_.send(metrics.ImportEvents.ERROR.value(this.errorCount_));
+
// Send aggregate deduplication timings, to avoid flooding analytics with one
// timing per file.
var deduplicatorStats = this.deduplicator_.getStatistics();
« no previous file with comments | « no previous file | ui/file_manager/file_manager/common/js/metrics_events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698