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

Unified Diff: net/reporting/reporting_report.h

Issue 2900553004: Reporting: Add histograms. (Closed)
Patch Set: oops, forgot about dependency Created 3 years, 7 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
Index: net/reporting/reporting_report.h
diff --git a/net/reporting/reporting_report.h b/net/reporting/reporting_report.h
index b1b310171f99491fb171d82e4134bee5455516a4..61ed07436693c1f9312ad2695daa7625b5640231 100644
--- a/net/reporting/reporting_report.h
+++ b/net/reporting/reporting_report.h
@@ -21,6 +21,23 @@ 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_INVALID_TYPE_FROM_RENDERER = 1,
+ DISCARDED_NO_URL_REQUEST_CONTEXT = 2,
+ DISCARDED_NO_REPORTING_SERVICE = 3,
+ ERASED_FAILED = 4,
+ ERASED_EXPIRED = 5,
+ ERASED_EVICTED = 6,
+ ERASED_NETWORK_CHANGED = 7,
+ ERASED_BROWSING_DATA_REMOVED = 8,
+ ERASED_REPORTING_SHUT_DOWN = 9,
+ DELIVERED = 10,
+
+ MAX
+ };
+
ReportingReport(const GURL& url,
const std::string& group,
const std::string& type,
@@ -29,6 +46,12 @@ struct NET_EXPORT ReportingReport {
int attempts);
~ReportingReport();
+ static void RecordReportDiscardedForInvalidTypeFromRenderer();
+ 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 +74,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);
};

Powered by Google App Engine
This is Rietveld 408576698