Skip to content

Commit

Permalink
Reporting: Move histograms to Net.Reporting.* namespace.
Browse files Browse the repository at this point in the history
...and take the opportunity to prune and reorder enums.

Change-Id: I260f24bbe33781f27d41cf37296be0b84070f26f
Reviewed-on: https://chromium-review.googlesource.com/957163
Commit-Queue: Julia Tuttle <juliatuttle@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543775}
  • Loading branch information
juliatuttle authored and Commit Bot committed Mar 16, 2018
1 parent 4b0cdbb commit 2348b44
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 30 deletions.
44 changes: 18 additions & 26 deletions net/reporting/reporting_header_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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
};
Expand All @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions net/reporting/reporting_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion net/reporting/reporting_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
59 changes: 59 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30301,6 +30301,53 @@ Called by update_net_error_codes.py.-->
<int value="8" label="subresource and used"/>
</enum>

<enum name="NetReportingHeaderEndpointGroupOutcome">
<int value="0" label="Discarded: not a dictionary"/>
<int value="1" label="Discarded: group not a string"/>
<int value="2" label="Discarded: TTL missing"/>
<int value="3" label="Discarded: TTL not an integer"/>
<int value="4" label="Discarded: TTL negative"/>
<int value="5" label="Discarded: endpoints missing"/>
<int value="6" label="Discarded: endpoints not a list"/>
<int value="7" label="Parsed"/>
</enum>

<enum name="NetReportingHeaderEndpointOutcome">
<int value="0" label="Discarded: not a dictionary"/>
<int value="1" label="Discarded: URL missing"/>
<int value="2" label="Discarded: URL not a string"/>
<int value="3" label="Discarded: URL invalid"/>
<int value="4" label="Discarded: URL insecure"/>
<int value="5" label="Discarded: priority not an integer"/>
<int value="6" label="Discarded: weight not an integer"/>
<int value="7" label="Discarded: weight not positive"/>
<int value="8" label="Removed (max-age = 0)"/>
<int value="9" label="Set rejected by delegate (max-age &gt; 0)"/>
<int value="10" label="Set (max-age &gt; 0)"/>
</enum>

<enum name="NetReportingHeaderOutcome">
<int value="0" label="Discarded: no ReportingService"/>
<int value="1" label="Discarded: invalid SSLInfo"/>
<int value="2" label="Discarded: cert status error"/>
<int value="3" label="Discarded: JSON too big"/>
<int value="4" label="Discarded: JSON invalid"/>
<int value="5" label="Parsed"/>
</enum>

<enum name="NetReportingReportOutcome">
<int value="0" label="Unknown"/>
<int value="1" label="Discarded: no URLRequestContext"/>
<int value="2" label="Discarded: no ReportingService"/>
<int value="3" label="Erased: failed"/>
<int value="4" label="Erased: expired"/>
<int value="5" label="Erased: evicted"/>
<int value="6" label="Erased: network changed"/>
<int value="7" label="Erased: browsing data removed"/>
<int value="8" label="Erased: Reporting shut down"/>
<int value="9" label="Delivered"/>
</enum>

<enum name="NetTrustAnchors">
<!-- Generated from net/data/ssl/root_stores/root_stores.json.
Called by update_net_trust_anchors.py.-->
Expand Down Expand Up @@ -37953,6 +38000,9 @@ Called by update_net_trust_anchors.py.-->
</enum>

<enum name="ReportingHeaderEndpointGroupOutcome">
<obsolete>
Moved to NetReportingHeaderEndpointGroupOutcome.
</obsolete>
<int value="0" label="Discarded: not a dictionary"/>
<int value="1" label="Discarded: group not a string"/>
<int value="2" label="Discarded: TTL missing"/>
Expand All @@ -37964,6 +38014,9 @@ Called by update_net_trust_anchors.py.-->
</enum>

<enum name="ReportingHeaderEndpointOutcome">
<obsolete>
Moved to NetReportingHeaderEndpointOutcome.
</obsolete>
<int value="0" label="Discarded: not a dictionary"/>
<int value="1" label="Discarded: endpoint missing (obsolete)"/>
<int value="2" label="Discarded: endpoint not a string (obsolete)"/>
Expand All @@ -37986,6 +38039,9 @@ Called by update_net_trust_anchors.py.-->
</enum>

<enum name="ReportingHeaderOutcome">
<obsolete>
Moved to NetReportingHeaderOutcome.
</obsolete>
<int value="0" label="Discarded: no ReportingService"/>
<int value="1" label="Discarded: invalid SSLInfo"/>
<int value="2" label="Discarded: cert status error"/>
Expand All @@ -37995,6 +38051,9 @@ Called by update_net_trust_anchors.py.-->
</enum>

<enum name="ReportingReportOutcome">
<obsolete>
Moved to NetReportingReportOutcome.
</obsolete>
<int value="0" label="Unknown"/>
<int value="1" label="Discarded: no URLRequestContext"/>
<int value="2" label="Discarded: no ReportingService"/>
Expand Down
70 changes: 70 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48330,6 +48330,58 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>

<histogram name="Net.Reporting.HeaderEndpointGroupOutcome"
enum="NetReportingHeaderEndpointGroupOutcome">
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to process a single endpoint group in a
Report-To header once the header itself has been parsed.
</summary>
</histogram>

<histogram name="Net.Reporting.HeaderEndpointOutcome"
enum="NetReportingHeaderEndpointOutcome">
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to process a single endpoint in a Report-To
header once the header itself has been parsed.
</summary>
</histogram>

<histogram name="Net.Reporting.HeaderOutcome" enum="NetReportingHeaderOutcome">
<owner>juliatuttle@chromium.org</owner>
<summary>
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.
</summary>
</histogram>

<histogram name="Net.Reporting.ReportDeliveredAttempts" units="attempts">
<owner>juliatuttle@chromium.org</owner>
<summary>
When Reporting successfully delivers a report, the number of unsuccessful
delivery attempts that preceded the successful one.
</summary>
</histogram>

<histogram name="Net.Reporting.ReportDeliveredLatency" units="ms">
<owner>juliatuttle@chromium.org</owner>
<summary>
The delivery latency of reports successfully delivered by Reporting. Starts
when the report is queued and finishes when the delivery attempt returns
successfully.
</summary>
</histogram>

<histogram name="Net.Reporting.ReportOutcome" enum="NetReportingReportOutcome">
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to deliver a report, recorded when the
report is finally erased from memory.
</summary>
</histogram>

<histogram name="Net.RequestTime">
<obsolete>
Replaced by Net.RequestTime2 due to bug in original implementation.
Expand Down Expand Up @@ -73608,6 +73660,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.

<histogram name="Reporting.HeaderEndpointGroupOutcome"
enum="ReportingHeaderEndpointGroupOutcome">
<obsolete>
Moved to Net.Reporting.HeaderEndpointGroupOutcome.
</obsolete>
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to process a single endpoint group in a
Expand All @@ -73617,6 +73672,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.

<histogram name="Reporting.HeaderEndpointOutcome"
enum="ReportingHeaderEndpointOutcome">
<obsolete>
Moved to Net.Reporting.HeaderEndpointOutcome.
</obsolete>
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to process a single endpoint in a Report-To
Expand All @@ -73625,6 +73683,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</histogram>

<histogram name="Reporting.HeaderOutcome" enum="ReportingHeaderOutcome">
<obsolete>
Moved to Net.Reporting.HeaderOutcome.
</obsolete>
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to process a Report-To header. Once it is
Expand All @@ -73634,6 +73695,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</histogram>

<histogram name="Reporting.ReportDeliveredAttempts" units="attempts">
<obsolete>
Moved to Net.Reporting.ReportDeliveredAttempts.
</obsolete>
<owner>juliatuttle@chromium.org</owner>
<summary>
When Reporting successfully delivers a report, the number of unsuccessful
Expand All @@ -73642,6 +73706,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</histogram>

<histogram name="Reporting.ReportDeliveredLatency" units="ms">
<obsolete>
Moved to Net.Reporting.ReportDeliveredLatency.
</obsolete>
<owner>juliatuttle@chromium.org</owner>
<summary>
The delivery latency of reports successfully delivered by Reporting. Starts
Expand All @@ -73651,6 +73718,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</histogram>

<histogram name="Reporting.ReportOutcome" enum="ReportingReportOutcome">
<obsolete>
Moved to Net.Reporting.ReportOutcome.
</obsolete>
<owner>juliatuttle@chromium.org</owner>
<summary>
The outcome of Reporting trying to deliver a report, recorded when the
Expand Down

0 comments on commit 2348b44

Please sign in to comment.