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

Unified Diff: components/browser_watcher/postmortem_report_collector.cc

Issue 2719343002: Get visibility into stability file accumulation (Closed)
Patch Set: Created 3 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_watcher/postmortem_report_collector.cc
diff --git a/components/browser_watcher/postmortem_report_collector.cc b/components/browser_watcher/postmortem_report_collector.cc
index 7f5bf1457b81517991d604bfc1a754b9ef75f950..deb200fd259af8a3311774c46852dfdb1f24df98 100644
--- a/components/browser_watcher/postmortem_report_collector.cc
+++ b/components/browser_watcher/postmortem_report_collector.cc
@@ -170,6 +170,8 @@ int PostmortemReportCollector::CollectAndSubmitForUpload(
// Collect the list of files to harvest.
std::vector<FilePath> debug_files = GetDebugStateFilePaths(
debug_info_dir, debug_file_pattern, excluded_debug_files);
+ UMA_HISTOGRAM_COUNTS_100("ActivityTracker.Collect.StabilityFileCount",
+ debug_files.size());
// Determine the crashpad client id.
crashpad::UUID client_id;
@@ -242,6 +244,7 @@ PostmortemReportCollector::CollectAndSubmit(
CrashReportDatabase::OperationStatus database_status =
report_database->PrepareNewCrashReport(&new_report);
if (database_status != CrashReportDatabase::kNoError) {
+ // Assume this is recoverable: not deleting the file.
LOG(ERROR) << "PrepareNewCrashReport failed";
Sigurður Ásgeirsson 2017/02/28 15:45:41 Out of curiosity - how are these LOGs useful? Have
manzagop (departed) 2017/02/28 16:07:39 Done.
return PREPARE_NEW_CRASH_REPORT_FAILED;
}
@@ -251,6 +254,9 @@ PostmortemReportCollector::CollectAndSubmit(
// Write the report to a minidump.
if (!WriteReportToMinidump(report_proto.get(), client_id, new_report->uuid,
reinterpret_cast<FILE*>(new_report->handle))) {
+ // Assume this is not recoverable and delete the file.
+ if (!base::DeleteFile(file, false))
+ LOG(ERROR) << "Failed to delete " << file.value();
return WRITE_TO_MINIDUMP_FAILED;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698