Skip to content

Commit

Permalink
Cros: Update captive portal histograms
Browse files Browse the repository at this point in the history
1. Moves the Chrome OS network captive portal histograms to
   network/histograms.xml since they are strongly tied to the
   chromeos networking code and not directlyr elated to the
   chrome captive portal code or metrics. This requires an
   additional entry to _NAMESPACES_IN_MULTIPLE_FILES in
   tools/metrics/histograms/validate_format.py.
2. Updates the expiration date of the moved CaptivePortal metrics.
3. Converts calls to use functions instead of macros.

BUG=b:242618993

(cherry picked from commit 2e2c931)

Change-Id: I0ed7edbb33c3f33318f7b8752ca27fc32dbf9a07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3830083
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Quick-Run: Steven Bennetts <stevenjb@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1036888}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3852527
Auto-Submit: Steven Bennetts <stevenjb@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#77}
Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
  • Loading branch information
stevenjb authored and Chromium LUCI CQ committed Aug 24, 2022
1 parent 92be1ae commit 0a852d8
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 58 deletions.
7 changes: 3 additions & 4 deletions chrome/browser/ash/net/network_portal_detector_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_functions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
Expand Down Expand Up @@ -366,14 +366,13 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
<< ", status=" << status
<< ", response_code=" << response_code;

UMA_HISTOGRAM_ENUMERATION("CaptivePortal.NetworkPortalDetectorResult",
status);
base::UmaHistogramEnumeration("Network.NetworkPortalDetectorResult", status);
NetworkState::NetworkTechnologyType type =
NetworkState::NetworkTechnologyType::kUnknown;
if (status == CAPTIVE_PORTAL_STATUS_PORTAL) {
if (network)
type = network->GetNetworkTechnologyType();
UMA_HISTOGRAM_ENUMERATION("CaptivePortal.NetworkPortalDetectorType", type);
base::UmaHistogramEnumeration("Network.NetworkPortalDetectorType", type);
}

if (last_detection_status_ != status) {
Expand Down
7 changes: 3 additions & 4 deletions chromeos/ash/components/network/network_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <utility>

#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
Expand Down Expand Up @@ -667,13 +666,13 @@ void NetworkState::UpdateCaptivePortalState(const base::Value& properties) {
shill_portal_state_ = PortalState::kUnknown;
}

UMA_HISTOGRAM_ENUMERATION("CaptivePortal.NetworkStateResult",
shill_portal_state_);
base::UmaHistogramEnumeration("Network.CaptivePortalResult",
shill_portal_state_);
if (shill_portal_state_ != PortalState::kOnline) {
NET_LOG(EVENT) << "Shill captive portal state for: " << NetworkId(this)
<< " = " << shill_portal_state_
<< " ,status_code=" << status_code;
base::UmaHistogramSparse("CaptivePortal.NetworkStateStatusCode",
base::UmaHistogramSparse("Network.CaptivePortalStatusCode",
std::abs(status_code));
}
}
Expand Down
45 changes: 45 additions & 0 deletions tools/metrics/histograms/metadata/network/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,28 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="Network.CaptivePortalResult" enum="CaptivePortalNetworkState"
expires_after="2023-09-18">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Captive portal detection state from Shill received by NetworkState. NOTE:
This metric used to be CaptivePortal.NetworkPortalDetectorResult which was
expired from 2021-04-01 to 2022-09-18.
</summary>
</histogram>

<histogram name="Network.CaptivePortalStatusCode" enum="HttpResponseCode"
expires_after="2023-09-18">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Captive portal status code reported by Shill and received by NetworkState.
NOTE: This metric used to be CaptivePortal.NetworkStateStatusCode which was
expired from 2021-04-01 to 2022-09-18.
</summary>
</histogram>

<histogram name="Network.Cellular.Apn.UseAttachApnOnSave" enum="Boolean"
expires_after="2022-05-18">
<owner>hsuregan@chromium.org</owner>
Expand Down Expand Up @@ -1140,6 +1162,29 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="Network.NetworkPortalDetectorResult"
enum="NetworkPortalStatus" expires_after="2023-09-18">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Chrome captive portal detection results on ChromeOS. NOTE: This metric used
to be CaptivePortal.NetworkPortalDetectorResult which was expired from
2021-09-27 to 2022-09-18.
</summary>
</histogram>

<histogram name="Network.NetworkPortalDetectorType" enum="NetworkTechnology"
expires_after="2023-09-18">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Captive portal detection network type recorded when Chrome on ChromeOS
detects a captive portal. NOTE: This metric used to be
CaptivePortal.NetworkPortalDetectorType which was expired from 2021-09-27 to
2022-09-18.
</summary>
</histogram>

<histogram name="Network.Patchpanel.ArcService"
enum="NetworkPatchpanelArcEvent" expires_after="2022-12-31">
<owner>hugobenichi@google.com</owner>
Expand Down
50 changes: 0 additions & 50 deletions tools/metrics/histograms/metadata/others/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1770,56 +1770,6 @@ chromium-metrics-reviews@google.com.
<summary>Records the result of a captive portal probe.</summary>
</histogram>

<histogram name="CaptivePortal.NetworkPortalDetectorResult"
enum="NetworkPortalStatus" expires_after="2021-09-27">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>Chrome captive portal detection results on Chrome OS.</summary>
</histogram>

<histogram name="CaptivePortal.NetworkPortalDetectorType"
enum="NetworkTechnology" expires_after="2021-09-27">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Captive portal detection network type recorded when Chrome on Chrome OS
detects a captive portal.
</summary>
</histogram>

<histogram name="CaptivePortal.NetworkStateResult"
enum="CaptivePortalNetworkState" expires_after="2021-04-01">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Captive portal detection state from Shill received by NetworkState.
</summary>
</histogram>

<histogram name="CaptivePortal.NetworkStateStatusCode" enum="HttpResponseCode"
expires_after="2021-04-01">
<owner>stevenjb@chromium.org</owner>
<owner>cros-network-health@google.com</owner>
<summary>
Captive portal status code reported by Shill and received by NetworkState.
</summary>
</histogram>

<histogram name="CaptivePortal.ProbeReason" enum="CaptivePortalProbeReason"
expires_after="2021-08-09">
<obsolete>
Removed from code 2021-08.
</obsolete>
<owner>ericorth@chromium.org</owner>
<owner>doh-core@google.com</owner>
<owner>cros-networking@google.com</owner>
<summary>
Reason for attempting a captive portal probe. This is logged only when a
probe HTTP request is made. If there are multiple reasons that triggered
this probe, only the first is logged.
</summary>
</histogram>

<histogram name="Cast.Channel.Certificate" enum="CastCertificateStatus"
expires_after="never">
<!-- expires-never: Used for Cast device health monitoring. -->
Expand Down

0 comments on commit 0a852d8

Please sign in to comment.