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; |
} |