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

Unified Diff: net/reporting/reporting_report.h

Issue 2900553004: Reporting: Add histograms. (Closed)
Patch Set: rebase Created 3 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 | « net/reporting/reporting_network_change_observer.cc ('k') | net/reporting/reporting_report.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_report.h
diff --git a/net/reporting/reporting_report.h b/net/reporting/reporting_report.h
index b1b310171f99491fb171d82e4134bee5455516a4..e7fba5d5950973c0e979fb107b1f7dd60970d1e5 100644
--- a/net/reporting/reporting_report.h
+++ b/net/reporting/reporting_report.h
@@ -21,6 +21,22 @@ namespace net {
// An undelivered report.
struct NET_EXPORT ReportingReport {
public:
+ // Used in histograms; please add new items at end and do not reorder.
+ enum class Outcome {
+ UNKNOWN = 0,
+ DISCARDED_NO_URL_REQUEST_CONTEXT = 1,
+ DISCARDED_NO_REPORTING_SERVICE = 2,
+ ERASED_FAILED = 3,
+ ERASED_EXPIRED = 4,
+ ERASED_EVICTED = 5,
+ ERASED_NETWORK_CHANGED = 6,
+ ERASED_BROWSING_DATA_REMOVED = 7,
+ ERASED_REPORTING_SHUT_DOWN = 8,
+ DELIVERED = 9,
+
+ MAX
+ };
+
ReportingReport(const GURL& url,
const std::string& group,
const std::string& type,
@@ -29,6 +45,11 @@ struct NET_EXPORT ReportingReport {
int attempts);
~ReportingReport();
+ static void RecordReportDiscardedForNoURLRequestContext();
+ static void RecordReportDiscardedForNoReportingService();
+
+ void RecordOutcome(base::TimeTicks now);
+
// The URL of the document that triggered the report. (Included in the
// delivered report.)
GURL url;
@@ -51,7 +72,11 @@ struct NET_EXPORT ReportingReport {
// attempt. (Not included in the delivered report.)
int attempts = 0;
+ Outcome outcome;
+
private:
+ bool recorded_outcome;
+
DISALLOW_COPY_AND_ASSIGN(ReportingReport);
};
« no previous file with comments | « net/reporting/reporting_network_change_observer.cc ('k') | net/reporting/reporting_report.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698