From 2348b44d2a5ba4e78f21bdd8a67d89e718f02ef6 Mon Sep 17 00:00:00 2001 From: Julia Tuttle Date: Fri, 16 Mar 2018 19:14:42 +0000 Subject: [PATCH] Reporting: Move histograms to Net.Reporting.* namespace. ...and take the opportunity to prune and reorder enums. Change-Id: I260f24bbe33781f27d41cf37296be0b84070f26f Reviewed-on: https://chromium-review.googlesource.com/957163 Commit-Queue: Julia Tuttle Reviewed-by: Robert Kaplow Cr-Commit-Position: refs/heads/master@{#543775} --- net/reporting/reporting_header_parser.cc | 44 ++++++--------- net/reporting/reporting_report.cc | 6 +- net/reporting/reporting_report.h | 1 - tools/metrics/histograms/enums.xml | 59 ++++++++++++++++++++ tools/metrics/histograms/histograms.xml | 70 ++++++++++++++++++++++++ 5 files changed, 150 insertions(+), 30 deletions(-) diff --git a/net/reporting/reporting_header_parser.cc b/net/reporting/reporting_header_parser.cc index b05c72c9d8320a..001fc0e459198c 100644 --- a/net/reporting/reporting_header_parser.cc +++ b/net/reporting/reporting_header_parser.cc @@ -26,15 +26,15 @@ enum class HeaderOutcome { DISCARDED_NO_REPORTING_SERVICE = 0, DISCARDED_INVALID_SSL_INFO = 1, DISCARDED_CERT_STATUS_ERROR = 2, - DISCARDED_JSON_INVALID = 3, - PARSED = 4, - DISCARDED_JSON_TOO_BIG = 5, + DISCARDED_JSON_TOO_BIG = 3, + DISCARDED_JSON_INVALID = 4, + PARSED = 5, MAX }; void RecordHeaderOutcome(HeaderOutcome outcome) { - UMA_HISTOGRAM_ENUMERATION("Reporting.HeaderOutcome", outcome, + UMA_HISTOGRAM_ENUMERATION("Net.Reporting.HeaderOutcome", outcome, HeaderOutcome::MAX); } @@ -46,38 +46,30 @@ enum class HeaderEndpointGroupOutcome { DISCARDED_TTL_NEGATIVE = 4, DISCARDED_ENDPOINTS_MISSING = 5, DISCARDED_ENDPOINTS_NOT_LIST = 6, + PARSED = 7, MAX }; void RecordHeaderEndpointGroupOutcome(HeaderEndpointGroupOutcome outcome) { - UMA_HISTOGRAM_ENUMERATION("Reporting.HeaderEndpointGroupOutcome", outcome, + UMA_HISTOGRAM_ENUMERATION("Net.Reporting.HeaderEndpointGroupOutcome", outcome, HeaderEndpointGroupOutcome::MAX); } enum class HeaderEndpointOutcome { DISCARDED_NOT_DICTIONARY = 0, - DISCARDED_ENDPOINT_MISSING = 1, // obsolete - DISCARDED_ENDPOINT_NOT_STRING = 2, // obsolete - DISCARDED_ENDPOINT_INVALID = 3, // obsolete - DISCARDED_ENDPOINT_INSECURE = 4, // obsolete - DISCARDED_TTL_MISSING = 5, // obsolete - DISCARDED_TTL_NOT_INTEGER = 6, // obsolete - DISCARDED_TTL_NEGATIVE = 7, // obsolete - DISCARDED_GROUP_NOT_STRING = 8, // obsolete - REMOVED = 9, - SET_REJECTED_BY_DELEGATE = 10, - SET = 11, - - DISCARDED_PRIORITY_NOT_INTEGER = 12, - DISCARDED_WEIGHT_NOT_INTEGER = 13, - DISCARDED_WEIGHT_NOT_POSITIVE = 14, - - DISCARDED_URL_MISSING = 15, - DISCARDED_URL_NOT_STRING = 16, - DISCARDED_URL_INVALID = 17, - DISCARDED_URL_INSECURE = 18, + DISCARDED_URL_MISSING = 1, + DISCARDED_URL_NOT_STRING = 2, + DISCARDED_URL_INVALID = 3, + DISCARDED_URL_INSECURE = 4, + DISCARDED_PRIORITY_NOT_INTEGER = 5, + DISCARDED_WEIGHT_NOT_INTEGER = 6, + DISCARDED_WEIGHT_NOT_POSITIVE = 7, + + REMOVED = 8, + SET_REJECTED_BY_DELEGATE = 9, + SET = 10, MAX }; @@ -89,7 +81,7 @@ bool EndpointParsedSuccessfully(HeaderEndpointOutcome outcome) { } void RecordHeaderEndpointOutcome(HeaderEndpointOutcome outcome) { - UMA_HISTOGRAM_ENUMERATION("Reporting.HeaderEndpointOutcome", outcome, + UMA_HISTOGRAM_ENUMERATION("Net.Reporting.HeaderEndpointOutcome", outcome, HeaderEndpointOutcome::MAX); } diff --git a/net/reporting/reporting_report.cc b/net/reporting/reporting_report.cc index 37c4a22bd3decf..2a59484145fab7 100644 --- a/net/reporting/reporting_report.cc +++ b/net/reporting/reporting_report.cc @@ -18,7 +18,7 @@ namespace net { namespace { void RecordReportOutcome(ReportingReport::Outcome outcome) { - UMA_HISTOGRAM_ENUMERATION("Reporting.ReportOutcome", outcome, + UMA_HISTOGRAM_ENUMERATION("Net.Reporting.ReportOutcome", outcome, ReportingReport::Outcome::MAX); } @@ -59,9 +59,9 @@ void ReportingReport::RecordOutcome(base::TimeTicks now) { RecordReportOutcome(outcome); if (outcome == Outcome::DELIVERED) { - UMA_HISTOGRAM_LONG_TIMES_100("Reporting.ReportDeliveredLatency", + UMA_HISTOGRAM_LONG_TIMES_100("Net.Reporting.ReportDeliveredLatency", now - queued); - UMA_HISTOGRAM_COUNTS_100("Reporting.ReportDeliveredAttempts", attempts); + UMA_HISTOGRAM_COUNTS_100("Net.Reporting.ReportDeliveredAttempts", attempts); } recorded_outcome = true; diff --git a/net/reporting/reporting_report.h b/net/reporting/reporting_report.h index 1621ab0a49ddc5..e7fba5d5950973 100644 --- a/net/reporting/reporting_report.h +++ b/net/reporting/reporting_report.h @@ -33,7 +33,6 @@ struct NET_EXPORT ReportingReport { ERASED_BROWSING_DATA_REMOVED = 7, ERASED_REPORTING_SHUT_DOWN = 8, DELIVERED = 9, - ERASED_NO_BACKGROUND_SYNC_PERMISSION = 10, MAX }; diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 2edd0d02e63a58..c21673b52e1484 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml @@ -30301,6 +30301,53 @@ Called by update_net_error_codes.py.--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -37953,6 +38000,9 @@ Called by update_net_trust_anchors.py.--> + + Moved to NetReportingHeaderEndpointGroupOutcome. + @@ -37964,6 +38014,9 @@ Called by update_net_trust_anchors.py.--> + + Moved to NetReportingHeaderEndpointOutcome. + @@ -37986,6 +38039,9 @@ Called by update_net_trust_anchors.py.--> + + Moved to NetReportingHeaderOutcome. + @@ -37995,6 +38051,9 @@ Called by update_net_trust_anchors.py.--> + + Moved to NetReportingReportOutcome. + diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index d8c0561097f455..4caeea686ddcab 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -48330,6 +48330,58 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + juliatuttle@chromium.org + + The outcome of Reporting trying to process a single endpoint group in a + Report-To header once the header itself has been parsed. + + + + + juliatuttle@chromium.org + + The outcome of Reporting trying to process a single endpoint in a Report-To + header once the header itself has been parsed. + + + + + juliatuttle@chromium.org + + The outcome of Reporting trying to process a Report-To header. Once it is + parsed, Reporting.HeaderEndpointOutcome records the outcome of the endpoints + within it. + + + + + juliatuttle@chromium.org + + When Reporting successfully delivers a report, the number of unsuccessful + delivery attempts that preceded the successful one. + + + + + juliatuttle@chromium.org + + The delivery latency of reports successfully delivered by Reporting. Starts + when the report is queued and finishes when the delivery attempt returns + successfully. + + + + + juliatuttle@chromium.org + + The outcome of Reporting trying to deliver a report, recorded when the + report is finally erased from memory. + + + Replaced by Net.RequestTime2 due to bug in original implementation. @@ -73608,6 +73660,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + Moved to Net.Reporting.HeaderEndpointGroupOutcome. + juliatuttle@chromium.org The outcome of Reporting trying to process a single endpoint group in a @@ -73617,6 +73672,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + Moved to Net.Reporting.HeaderEndpointOutcome. + juliatuttle@chromium.org The outcome of Reporting trying to process a single endpoint in a Report-To @@ -73625,6 +73683,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + Moved to Net.Reporting.HeaderOutcome. + juliatuttle@chromium.org The outcome of Reporting trying to process a Report-To header. Once it is @@ -73634,6 +73695,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + Moved to Net.Reporting.ReportDeliveredAttempts. + juliatuttle@chromium.org When Reporting successfully delivers a report, the number of unsuccessful @@ -73642,6 +73706,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + Moved to Net.Reporting.ReportDeliveredLatency. + juliatuttle@chromium.org The delivery latency of reports successfully delivered by Reporting. Starts @@ -73651,6 +73718,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. + + Moved to Net.Reporting.ReportOutcome. + juliatuttle@chromium.org The outcome of Reporting trying to deliver a report, recorded when the