Remove obsolete Installer.* metrics.
These metrics were replaced by the UpdateEngine.* metrics.
Bug: chromium:355745
Test: FEATURES=test emerge-link update_engine
Change-Id: I80d0db44681c428898500dd9099918e98ae40b28
diff --git a/delta_performer.cc b/delta_performer.cc
index 2538329..baeef08 100644
--- a/delta_performer.cc
+++ b/delta_performer.cc
@@ -449,7 +449,6 @@
<< install_plan_->metadata_size
<< ") in Omaha response as validation is not mandatory. "
<< "Trusting metadata size in payload = " << metadata_size_;
- SendUmaStat(ErrorCode::kDownloadInvalidMetadataSize);
}
// We have the full metadata in |payload|. Verify its integrity
@@ -465,7 +464,6 @@
// For non-mandatory cases, just send a UMA stat.
LOG(WARNING) << "Ignoring metadata signature validation failures";
- SendUmaStat(*error);
*error = ErrorCode::kSuccess;
}
@@ -595,7 +593,6 @@
// For non-mandatory cases, just send a UMA stat.
LOG(WARNING) << "Ignoring operation validation errors";
- SendUmaStat(*error);
*error = ErrorCode::kSuccess;
}
}
@@ -1036,9 +1033,7 @@
return ErrorCode::kDownloadMetadataSignatureMissingError;
}
- // For non-mandatory cases, just send a UMA stat.
LOG(WARNING) << "Cannot validate metadata as the signature is empty";
- SendUmaStat(ErrorCode::kDownloadMetadataSignatureMissingError);
return ErrorCode::kSuccess;
}
@@ -1171,10 +1166,8 @@
return ErrorCode::kDownloadOperationHashMissingError;
}
- // For non-mandatory cases, just send a UMA stat.
LOG(WARNING) << "Cannot validate operation " << next_operation_num_ + 1
<< " as there's no operation hash in manifest";
- SendUmaStat(ErrorCode::kDownloadOperationHashMissingError);
}
return ErrorCode::kSuccess;
}
@@ -1540,8 +1533,4 @@
return true;
}
-void DeltaPerformer::SendUmaStat(ErrorCode code) {
- utils::SendErrorCodeToUma(system_state_, code);
-}
-
} // namespace chromeos_update_engine
diff --git a/delta_performer.h b/delta_performer.h
index 38a4151..04ae083 100644
--- a/delta_performer.h
+++ b/delta_performer.h
@@ -308,9 +308,6 @@
// update. Returns false otherwise.
bool PrimeUpdateState();
- // Sends UMA statistics for the given error code.
- void SendUmaStat(ErrorCode code);
-
// If the Omaha response contains a public RSA key and we're allowed
// to use it (e.g. if we're in developer mode), extract the key from
// the response and store it in a temporary file and return true. In
diff --git a/error_code.h b/error_code.h
index 417e585..fdef895 100644
--- a/error_code.h
+++ b/error_code.h
@@ -90,7 +90,7 @@
// particular value for this enum so that it's just one more than the last
// one above and thus always represents the correct count of UMA metrics
// buckets, even when new enums are added above this line in future. See
- // utils::SendErrorCodeToUma on how this enum is used.
+ // metrics::ReportUpdateAttemptMetrics() on how this enum is used.
kUmaReportedMax,
// use the 2xxx range to encode HTTP errors. These errors are available in
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 05d950f..8967762 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -1343,13 +1343,7 @@
if (!prefs->SetInt64(kPrefsInstallDateDays, install_date_days))
return false;
- string metric_name = "Installer.InstallDateProvisioningSource";
- system_state->metrics_lib()->SendEnumToUMA(
- metric_name,
- static_cast<int>(source), // Sample.
- kProvisionedMax); // Maximum.
-
- metric_name = metrics::kMetricInstallDateProvisioningSource;
+ string metric_name = metrics::kMetricInstallDateProvisioningSource;
system_state->metrics_lib()->SendEnumToUMA(
metric_name,
static_cast<int>(source), // Sample.
diff --git a/payload_state.cc b/payload_state.cc
index 78c048b..9a1c740 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -114,7 +114,6 @@
SetNumResponsesSeen(num_responses_seen_ + 1);
SetResponseSignature(new_response_signature);
ResetPersistedState();
- ReportUpdatesAbandonedEventCountMetric();
return;
}
@@ -420,18 +419,6 @@
void PayloadState::IncrementPayloadAttemptNumber() {
// Update the payload attempt number for both payload types: full and delta.
SetPayloadAttemptNumber(GetPayloadAttemptNumber() + 1);
-
- // Report the metric every time the value is incremented.
- string metric = "Installer.PayloadAttemptNumber";
- int value = GetPayloadAttemptNumber();
-
- LOG(INFO) << "Uploading " << value << " (count) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- value,
- 1, // min value
- 50, // max value
- kNumDefaultUmaBuckets);
}
void PayloadState::IncrementFullPayloadAttemptNumber() {
@@ -444,18 +431,6 @@
LOG(INFO) << "Incrementing the full payload attempt number";
SetFullPayloadAttemptNumber(GetFullPayloadAttemptNumber() + 1);
UpdateBackoffExpiryTime();
-
- // Report the metric every time the value is incremented.
- string metric = "Installer.FullPayloadAttemptNumber";
- int value = GetFullPayloadAttemptNumber();
-
- LOG(INFO) << "Uploading " << value << " (count) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- value,
- 1, // min value
- 50, // max value
- kNumDefaultUmaBuckets);
}
void PayloadState::IncrementUrlIndex() {
@@ -679,7 +654,6 @@
string metric;
// Report metrics collected from all known download sources to UMA.
- int64_t successful_bytes_by_source[kNumDownloadSources];
int64_t total_bytes_by_source[kNumDownloadSources];
int64_t successful_bytes = 0;
int64_t total_bytes = 0;
@@ -697,7 +671,6 @@
// zero-byte events in the histogram.
bytes = GetCurrentBytesDownloaded(source);
- successful_bytes_by_source[i] = bytes;
successful_bytes += bytes;
successful_mbs += bytes / kNumBytesInOneMiB;
SetCurrentBytesDownloaded(source, 0, true);
@@ -722,7 +695,6 @@
SetNumReboots(0);
TimeDelta duration = GetUpdateDuration();
- TimeDelta duration_uptime = GetUpdateDurationUptime();
prefs_->Delete(kPrefsUpdateTimestampStart);
prefs_->Delete(kPrefsUpdateDurationUptime);
@@ -745,142 +717,6 @@
duration,
reboot_count,
url_switch_count);
-
- // TODO(zeuthen): This is the old metric reporting code which is
- // slated for removal soon. See http://crbug.com/355745 for details.
-
- // The old metrics code is using MiB's instead of bytes to calculate
- // the overhead which due to rounding makes the numbers slightly
- // different.
- download_overhead_percentage = 0;
- if (successful_mbs > 0) {
- download_overhead_percentage = (total_mbs - successful_mbs) * 100ULL /
- successful_mbs;
- }
-
- int download_sources_used = 0;
- for (int i = 0; i < kNumDownloadSources; i++) {
- DownloadSource source = static_cast<DownloadSource>(i);
- const int kMaxMiBs = 10240; // Anything above 10GB goes in the last bucket.
- int64_t mbs;
-
- // Only consider this download source (and send byte counts) as
- // having been used if we downloaded a non-trivial amount of bytes
- // (e.g. at least 1 MiB) that contributed to the final success of
- // the update. Otherwise we're going to end up with a lot of
- // zero-byte events in the histogram.
-
- mbs = successful_bytes_by_source[i] / kNumBytesInOneMiB;
- if (mbs > 0) {
- metric = "Installer.SuccessfulMBsDownloadedFrom" +
- utils::ToString(source);
- LOG(INFO) << "Uploading " << mbs << " (MBs) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(metric,
- mbs,
- 0, // min
- kMaxMiBs,
- kNumDefaultUmaBuckets);
- }
-
- mbs = total_bytes_by_source[i] / kNumBytesInOneMiB;
- if (mbs > 0) {
- metric = "Installer.TotalMBsDownloadedFrom" + utils::ToString(source);
- LOG(INFO) << "Uploading " << mbs << " (MBs) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(metric,
- mbs,
- 0, // min
- kMaxMiBs,
- kNumDefaultUmaBuckets);
- download_sources_used |= (1 << i);
- }
- }
-
- metric = "Installer.DownloadSourcesUsed";
- LOG(INFO) << "Uploading 0x" << std::hex << download_sources_used
- << " (bit flags) for metric " << metric;
- int num_buckets = min(1 << kNumDownloadSources, kNumDefaultUmaBuckets);
- system_state_->metrics_lib()->SendToUMA(metric,
- download_sources_used,
- 0, // min
- 1 << kNumDownloadSources,
- num_buckets);
-
- metric = "Installer.DownloadOverheadPercentage";
- LOG(INFO) << "Uploading " << download_overhead_percentage
- << "% for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(metric,
- download_overhead_percentage,
- 0, // min: 0% overhead
- 1000, // max: 1000% overhead
- kNumDefaultUmaBuckets);
-
- metric = "Installer.UpdateURLSwitches";
- LOG(INFO) << "Uploading " << url_switch_count
- << " (count) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- url_switch_count,
- 0, // min value
- 100, // max value
- kNumDefaultUmaBuckets);
-
- metric = "Installer.UpdateNumReboots";
- LOG(INFO) << "Uploading reboot count of " << reboot_count << " for metric "
- << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- reboot_count, // sample
- 0, // min = 0.
- 50, // max
- 25); // buckets
-
- metric = "Installer.UpdateDurationMinutes";
- system_state_->metrics_lib()->SendToUMA(
- metric,
- static_cast<int>(duration.InMinutes()),
- 1, // min: 1 minute
- 365*24*60, // max: 1 year (approx)
- kNumDefaultUmaBuckets);
- LOG(INFO) << "Uploading " << utils::FormatTimeDelta(duration)
- << " for metric " << metric;
-
- metric = "Installer.UpdateDurationUptimeMinutes";
- system_state_->metrics_lib()->SendToUMA(
- metric,
- static_cast<int>(duration_uptime.InMinutes()),
- 1, // min: 1 minute
- 30*24*60, // max: 1 month (approx)
- kNumDefaultUmaBuckets);
- LOG(INFO) << "Uploading " << utils::FormatTimeDelta(duration_uptime)
- << " for metric " << metric;
-
- metric = "Installer.PayloadFormat";
- system_state_->metrics_lib()->SendEnumToUMA(
- metric,
- payload_type,
- kNumPayloadTypes);
- LOG(INFO) << "Uploading " << utils::ToString(payload_type)
- << " for metric " << metric;
-
- metric = "Installer.AttemptsCount.Total";
- system_state_->metrics_lib()->SendToUMA(
- metric,
- attempt_count,
- 1, // min
- 50, // max
- kNumDefaultUmaBuckets);
- LOG(INFO) << "Uploading " << attempt_count
- << " for metric " << metric;
-
- metric = "Installer.UpdatesAbandonedCount";
- LOG(INFO) << "Uploading " << updates_abandoned_count
- << " (count) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- updates_abandoned_count,
- 0, // min value
- 100, // max value
- kNumDefaultUmaBuckets);
}
void PayloadState::UpdateNumReboots() {
@@ -1309,24 +1145,6 @@
prefs_->SetInt64(kPrefsNumResponsesSeen, num_responses_seen_);
}
-void PayloadState::ReportUpdatesAbandonedEventCountMetric() {
- string metric = "Installer.UpdatesAbandonedEventCount";
- int value = num_responses_seen_ - 1;
-
- // Do not send an "abandoned" event when 0 payloads were abandoned since the
- // last successful update.
- if (value == 0)
- return;
-
- LOG(INFO) << "Uploading " << value << " (count) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- value,
- 0, // min value
- 100, // max value
- kNumDefaultUmaBuckets);
-}
-
void PayloadState::ComputeCandidateUrls() {
bool http_url_ok = true;
@@ -1361,16 +1179,7 @@
void PayloadState::BootedIntoUpdate(TimeDelta time_to_reboot) {
// Send |time_to_reboot| as a UMA stat.
- string metric = "Installer.TimeToRebootMinutes";
- system_state_->metrics_lib()->SendToUMA(metric,
- time_to_reboot.InMinutes(),
- 0, // min: 0 minute
- 30*24*60, // max: 1 month (approx)
- kNumDefaultUmaBuckets);
- LOG(INFO) << "Uploading " << utils::FormatTimeDelta(time_to_reboot)
- << " for metric " << metric;
-
- metric = metrics::kMetricTimeToRebootMinutes;
+ string metric = metrics::kMetricTimeToRebootMinutes;
system_state_->metrics_lib()->SendToUMA(metric,
time_to_reboot.InMinutes(),
0, // min: 0 minute
@@ -1440,18 +1249,7 @@
}
// Report the UMA metric of the current boot failure.
- string metric = "Installer.RebootToNewPartitionAttempt";
-
- LOG(INFO) << "Uploading " << target_attempt
- << " (count) for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- target_attempt,
- 1, // min value
- 50, // max value
- kNumDefaultUmaBuckets);
-
- metric = metrics::kMetricFailedUpdateCount;
+ string metric = metrics::kMetricFailedUpdateCount;
LOG(INFO) << "Uploading " << target_attempt
<< " (count) for metric " << metric;
system_state_->metrics_lib()->SendToUMA(
diff --git a/payload_state.h b/payload_state.h
index 23c01a1..3616826 100644
--- a/payload_state.h
+++ b/payload_state.h
@@ -377,13 +377,6 @@
// Initializes |num_responses_seen_| from persisted state.
void LoadNumResponsesSeen();
- // Reports metric conveying how many times updates were abandoned since
- // the last update was applied. The difference between this metric and the
- // previous ReportUpdatesAbandonedCountMetric() one is that this metric is
- // reported every time an update is abandoned, as oposed to the mentioned
- // metric that is reported once the new update was applied.
- void ReportUpdatesAbandonedEventCountMetric();
-
// Initializes |num_reboots_| from the persisted state.
void LoadNumReboots();
diff --git a/payload_state_unittest.cc b/payload_state_unittest.cc
index e4eca89..012a3fc 100644
--- a/payload_state_unittest.cc
+++ b/payload_state_unittest.cc
@@ -324,10 +324,6 @@
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(_, _, _))
.Times(AnyNumber());
- // The first response doesn't send an abandoned event.
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.UpdatesAbandonedEventCount", 0, _, _, _)).Times(0);
-
// Set the first response.
SetupPayloadStateWith2Urls("Hash5823", true, &payload_state, &response);
EXPECT_EQ(1, payload_state.GetNumResponsesSeen());
@@ -338,9 +334,6 @@
EXPECT_EQ("https://test", payload_state.GetCurrentUrl());
EXPECT_EQ(1, payload_state.GetUrlSwitchCount());
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.UpdatesAbandonedEventCount", 1, _, _, _));
-
// Now, slightly change the response and set it again.
SetupPayloadStateWith2Urls("Hash8225", true, &payload_state, &response);
EXPECT_EQ(2, payload_state.GetNumResponsesSeen());
@@ -350,9 +343,6 @@
EXPECT_EQ("https://test", payload_state.GetCurrentUrl());
EXPECT_EQ(1, payload_state.GetUrlSwitchCount());
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.UpdatesAbandonedEventCount", 2, _, _, _));
-
// Return a third different response.
SetupPayloadStateWith2Urls("Hash9999", true, &payload_state, &response);
EXPECT_EQ(3, payload_state.GetNumResponsesSeen());
@@ -546,11 +536,6 @@
SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.PayloadAttemptNumber", 1, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.FullPayloadAttemptNumber", 1, _, _, _));
-
// This should just advance the payload attempt number;
EXPECT_EQ(0, payload_state.GetPayloadAttemptNumber());
EXPECT_EQ(0, payload_state.GetFullPayloadAttemptNumber());
@@ -591,13 +576,6 @@
SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
- // Metrics for Full payload attempt number is not sent with Delta payloads.
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.PayloadAttemptNumber", 1, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.FullPayloadAttemptNumber", _, _, _, _))
- .Times(0);
-
// This should just advance the payload attempt number;
EXPECT_EQ(0, payload_state.GetPayloadAttemptNumber());
EXPECT_EQ(0, payload_state.GetFullPayloadAttemptNumber());
@@ -873,7 +851,6 @@
int third_chunk = 32345678;
int http_chunk = first_chunk + third_chunk;
http_total += third_chunk;
- int https_chunk = second_chunk;
payload_state.DownloadProgress(third_chunk);
// Test that third chunk is again back on HTTP. HTTPS remains on second chunk.
@@ -901,58 +878,20 @@
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(_, _, _))
.Times(AnyNumber());
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.SuccessfulMBsDownloadedFromHttpServer",
- http_chunk / kNumBytesInOneMiB, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.TotalMBsDownloadedFromHttpServer",
- http_total / kNumBytesInOneMiB, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.SuccessfulMBsDownloadedFromHttpsServer",
- https_chunk / kNumBytesInOneMiB, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.TotalMBsDownloadedFromHttpsServer",
- https_total / kNumBytesInOneMiB, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.SuccessfulMBsDownloadedFromHttpPeer",
- p2p_total / kNumBytesInOneMiB, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.TotalMBsDownloadedFromHttpPeer",
- p2p_total / kNumBytesInOneMiB, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.UpdateURLSwitches",
- 3, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricSuccessfulUpdateUrlSwitchCount,
3, _, _, _));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.UpdateDurationMinutes",
- _, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricSuccessfulUpdateTotalDurationMinutes,
_, _, _, _));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.UpdateDurationUptimeMinutes",
- _, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.DownloadSourcesUsed",
- (1 << kDownloadSourceHttpsServer) | (1 << kDownloadSourceHttpServer) |
- (1 << kDownloadSourceHttpPeer),
- _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.DownloadOverheadPercentage", 318, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricSuccessfulUpdateDownloadOverheadPercentage,
314, _, _, _));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
- "Installer.PayloadFormat", kPayloadTypeFull, kNumPayloadTypes));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricAttemptPayloadType, kPayloadTypeFull, kNumPayloadTypes));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricSuccessfulUpdatePayloadType, kPayloadTypeFull,
kNumPayloadTypes));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.AttemptsCount.Total", 1, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricSuccessfulUpdateAttemptCount, 1, _, _, _));
payload_state.UpdateSucceeded();
@@ -991,10 +930,6 @@
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(_, _, _, _, _))
.Times(AnyNumber());
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.DownloadSourcesUsed",
- (1 << kDownloadSourceHttpServer),
- _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricSuccessfulUpdateDownloadSourcesUsed,
(1 << kDownloadSourceHttpServer),
_, _, _));
@@ -1199,9 +1134,6 @@
// Expect 500 - 30 seconds = 470 seconds ~= 7 min 50 sec
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.TimeToRebootMinutes",
- 7, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricTimeToRebootMinutes,
7, _, _, _));
fake_system_state.set_system_rebooted(true);
@@ -1394,8 +1326,6 @@
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(_, _, _))
.Times(AnyNumber());
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
- "Installer.PayloadFormat", kPayloadTypeDelta, kNumPayloadTypes));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricAttemptPayloadType, kPayloadTypeDelta, kNumPayloadTypes));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricSuccessfulUpdatePayloadType, kPayloadTypeDelta,
@@ -1414,8 +1344,6 @@
payload_state.DownloadComplete();
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
- "Installer.PayloadFormat", kPayloadTypeDelta, kNumPayloadTypes));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricAttemptPayloadType, kPayloadTypeDelta,
kNumPayloadTypes));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
@@ -1444,8 +1372,6 @@
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(_, _, _))
.Times(AnyNumber());
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
- "Installer.PayloadFormat", kPayloadTypeForcedFull, kNumPayloadTypes));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricAttemptPayloadType, kPayloadTypeForcedFull,
kNumPayloadTypes));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
@@ -1475,8 +1401,6 @@
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(_, _, _))
.Times(AnyNumber());
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
- "Installer.PayloadFormat", kPayloadTypeFull, kNumPayloadTypes));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
metrics::kMetricAttemptPayloadType, kPayloadTypeFull,
kNumPayloadTypes));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendEnumToUMA(
@@ -1502,8 +1426,6 @@
// Reboot into the same environment to get an UMA metric with a value of 1.
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.RebootToNewPartitionAttempt", 1, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricFailedUpdateCount, 1, _, _, _));
payload_state.ReportFailedBootIfNeeded();
Mock::VerifyAndClearExpectations(fake_system_state.mock_metrics_lib());
@@ -1513,8 +1435,6 @@
payload_state.ExpectRebootInNewVersion("Version:12345678");
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.RebootToNewPartitionAttempt", 2, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricFailedUpdateCount, 2, _, _, _));
payload_state.ReportFailedBootIfNeeded();
Mock::VerifyAndClearExpectations(fake_system_state.mock_metrics_lib());
@@ -1523,8 +1443,6 @@
// different payload. This should send a value of 1 this time.
payload_state.ExpectRebootInNewVersion("Version:3141592");
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.RebootToNewPartitionAttempt", 1, _, _, _));
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricFailedUpdateCount, 1, _, _, _));
payload_state.ReportFailedBootIfNeeded();
Mock::VerifyAndClearExpectations(fake_system_state.mock_metrics_lib());
@@ -1552,9 +1470,6 @@
fake_boot_control->SetCurrentSlot(1);
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.RebootToNewPartitionAttempt", _, _, _, _))
- .Times(0);
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricFailedUpdateCount, _, _, _, _))
.Times(0);
payload_state.ReportFailedBootIfNeeded();
@@ -1581,9 +1496,6 @@
payload_state.ExpectRebootInNewVersion("Version:12345678");
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.RebootToNewPartitionAttempt", _, _, _, _))
- .Times(0);
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricFailedUpdateCount, _, _, _, _))
.Times(0);
@@ -1603,9 +1515,6 @@
EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
- "Installer.RebootToNewPartitionAttempt", _, _, _, _))
- .Times(0);
- EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
metrics::kMetricFailedUpdateCount, _, _, _, _))
.Times(0);
diff --git a/update_attempter.cc b/update_attempter.cc
index cda244d..d4e1654 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -257,16 +257,6 @@
return;
}
- string metric = "Installer.OSAgeDays";
- LOG(INFO) << "Uploading " << utils::FormatTimeDelta(age)
- << " for metric " << metric;
- system_state_->metrics_lib()->SendToUMA(
- metric,
- static_cast<int>(age.InDays()),
- 0, // min: 0 days
- 6*30, // max: 6 months (approx)
- kNumDefaultUmaBuckets);
-
metrics::ReportDailyMetrics(system_state_, age);
}
@@ -1001,10 +991,6 @@
// next boot.
system_state_->payload_state()->ExpectRebootInNewVersion(
target_version_uid);
-
- // Also report the success code so that the percentiles can be
- // interpreted properly for the remaining error codes in UMA.
- utils::SendErrorCodeToUma(system_state_, code);
} else {
// If we just finished a rollback, then we expect to have no Omaha
// response. Otherwise, it's an error.
@@ -1314,11 +1300,8 @@
LOG(ERROR) << "Update failed.";
system_state_->payload_state()->UpdateFailed(error_event_->error_code);
- // Send it to Uma.
- LOG(INFO) << "Reporting the error event";
- utils::SendErrorCodeToUma(system_state_, error_event_->error_code);
-
// Send it to Omaha.
+ LOG(INFO) << "Reporting the error event";
shared_ptr<OmahaRequestAction> error_event_action(
new OmahaRequestAction(system_state_,
error_event_.release(), // Pass ownership.
diff --git a/utils.cc b/utils.cc
index 4018b37..98f3576 100644
--- a/utils.cc
+++ b/utils.cc
@@ -1246,56 +1246,6 @@
return metrics::ConnectionType::kUnknown;
}
-// Returns a printable version of the various flags denoted in the higher order
-// bits of the given code. Returns an empty string if none of those bits are
-// set.
-string GetFlagNames(uint32_t code) {
- uint32_t flags = (static_cast<uint32_t>(code) &
- static_cast<uint32_t>(ErrorCode::kSpecialFlags));
- string flag_names;
- string separator = "";
- for (size_t i = 0; i < sizeof(flags) * 8; i++) {
- uint32_t flag = flags & (1 << i);
- if (flag) {
- flag_names += separator + CodeToString(static_cast<ErrorCode>(flag));
- separator = ", ";
- }
- }
-
- return flag_names;
-}
-
-void SendErrorCodeToUma(SystemState* system_state, ErrorCode code) {
- if (!system_state)
- return;
-
- ErrorCode uma_error_code = GetBaseErrorCode(code);
-
- // If the code doesn't have flags computed already, compute them now based on
- // the state of the current update attempt.
- uint32_t flags =
- static_cast<int>(code) & static_cast<int>(ErrorCode::kSpecialFlags);
- if (!flags)
- flags = system_state->update_attempter()->GetErrorCodeFlags();
-
- // Determine the UMA bucket depending on the flags. But, ignore the resumed
- // flag, as it's perfectly normal for production devices to resume their
- // downloads and so we want to record those cases also in NormalErrorCodes
- // bucket.
- string metric =
- flags & ~static_cast<uint32_t>(ErrorCode::kResumedFlag) ?
- "Installer.DevModeErrorCodes" : "Installer.NormalErrorCodes";
-
- LOG(INFO) << "Sending error code " << uma_error_code
- << " (" << CodeToString(uma_error_code) << ")"
- << " to UMA metric: " << metric
- << ". Flags = " << (flags ? GetFlagNames(flags) : "None");
-
- system_state->metrics_lib()->SendEnumToUMA(
- metric, static_cast<int>(uma_error_code),
- static_cast<int>(ErrorCode::kUmaReportedMax));
-}
-
string CodeToString(ErrorCode code) {
// If the given code has both parts (i.e. the error code part and the flags
// part) then strip off the flags part since the switch statement below
diff --git a/utils.h b/utils.h
index 252feab..c1ee5a9 100644
--- a/utils.h
+++ b/utils.h
@@ -334,11 +334,6 @@
metrics::ConnectionType GetConnectionType(NetworkConnectionType type,
NetworkTethering tethering);
-// Sends the error code to UMA using the metrics interface object in the given
-// system state. It also uses the system state to determine the right UMA
-// bucket for the error code.
-void SendErrorCodeToUma(SystemState* system_state, ErrorCode code);
-
// Returns a string representation of the ErrorCodes (either the base
// error codes or the bit flags) for logging purposes.
std::string CodeToString(ErrorCode code);