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

Unified Diff: update_attempter.cc

Issue 2868061: Measure and send update time to UMA. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 5 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 | « update_attempter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index b5d9644970e94abc67efd75a35cca9247f839654..76a0d6349a10fd9e2ef63c0af9c8079deb13c88d 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -13,7 +13,10 @@
#include <tr1/memory>
#include <string>
#include <vector>
+
#include <glib.h>
+
+#include "metrics/metrics_library.h"
#include "update_engine/dbus_service.h"
#include "update_engine/download_action.h"
#include "update_engine/filesystem_copier_action.h"
@@ -205,6 +208,14 @@ void UpdateAttempter::ProcessingDone(const ActionProcessor* processor,
if (code == kActionCodeSuccess) {
SetStatusAndNotify(UPDATE_STATUS_UPDATED_NEED_REBOOT);
utils::WriteFile(kUpdateCompletedMarker, "", 0);
+
+ // Report the time it took to update the system.
+ int64_t update_time = time(NULL) - last_checked_time_;
+ metrics_lib_->SendToUMA("Installer.UpdateTime",
adlr 2010/07/20 00:08:57 s/Installer/UpdateEngine/?
petkov 2010/07/20 00:19:44 The convention we've been trying to follow is to k
+ static_cast<int>(update_time), // sample
+ 1, // min = 1 second
+ 20 * 60, // max = 20 minutes
adlr 2010/07/20 00:08:57 i could definitely see the long tail of updates ta
petkov 2010/07/20 00:19:44 The default histogram layout is exponential -- sma
+ 50); // buckets
} else {
LOG(INFO) << "Update failed.";
SetStatusAndNotify(UPDATE_STATUS_IDLE);
« no previous file with comments | « update_attempter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698