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

Unified Diff: src/platform/metrics/metrics_daemon.cc

Issue 1649007: metrics cleanup and fixes. (Closed)
Patch Set: Expose the pass/fail status. Created 10 years, 8 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 | « src/platform/metrics/metrics_daemon.h ('k') | src/platform/metrics/metrics_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/metrics/metrics_daemon.cc
diff --git a/src/platform/metrics/metrics_daemon.cc b/src/platform/metrics/metrics_daemon.cc
index a924b8ab4a9791c5750bc4de688e35f8ce7782b1..9bb9c205f1e8b199762d928e604fa2db479b9143 100644
--- a/src/platform/metrics/metrics_daemon.cc
+++ b/src/platform/metrics/metrics_daemon.cc
@@ -113,12 +113,10 @@ void MetricsDaemon::LogNetworkStateChange(const char* newstate) {
if (diff.tv_sec >= INT_MAX / 1000) {
diff_ms = INT_MAX;
}
- char buffer[100];
- snprintf(buffer, sizeof(buffer), "%d", diff_ms);
if (testing_) {
- TestPublishMetric(network_states_[old_id].stat_name, buffer);
+ TestPublishMetric(network_states_[old_id].stat_name, diff_ms);
} else {
- ChromePublishMetric(network_states_[old_id].stat_name, buffer);
+ ChromePublishMetric(network_states_[old_id].stat_name, diff_ms);
}
}
network_state_id_ = new_id;
@@ -135,10 +133,10 @@ MetricsDaemon::GetNetworkStateId(const char* state_name) {
return static_cast<NetworkStateId>(-1);
}
-void MetricsDaemon::ChromePublishMetric(const char* name, const char* value) {
+void MetricsDaemon::ChromePublishMetric(const char* name, int value) {
MetricsLibrary::SendToChrome(name, value);
}
-void MetricsDaemon::TestPublishMetric(const char* name, const char* value) {
+void MetricsDaemon::TestPublishMetric(const char* name, int value) {
LOG(INFO) << "received metric: " << name << " " << value;
}
« no previous file with comments | « src/platform/metrics/metrics_daemon.h ('k') | src/platform/metrics/metrics_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698