[connectivity_wlan] Fix connect_reason_dim
The connect_reason_dim event codes were accidentally set from 1-7 for some metrics, but the implementation used the
dimension from a previously submitted metric with event codes 0-6. This resulted
in an off-by-one error in the connection selection metrics, where the
correct event code is reported, but it gets cast to the wrong label.
This changes fixes that error. Unfortunately, we cannot use the already
written dimension with the correct event codes, because you cannot remove event codes from existing
metrics. Instead, this changes the dimension ONLY for the affected
metrics, and retains the obsolete event code.
An attempted fix at fxr/927793 was reverted, because the change made
some Fuchsia switch statements non-exhaustive. This change addresss that
error by not modifying the `policy_connection_attempt_migrated` `reason`
dimension, which is the dimension actually matched on in the Fuchsia code.
Test: Built Fuchsia with cobalt config change, to verify there are no
issues.
Change-Id: I8c5709c59e8d84ad2149930f894212fb25a41c31
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt-registry/+/932494
Reviewed-by: Francois Rousseau <frousseau@google.com>
Privacy-Approval: Francois Rousseau <frousseau@google.com>
Fuchsia-Auto-Submit: Hayden Nix <haydennix@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/fuchsia/connectivity_wlan/metrics.yaml b/fuchsia/connectivity_wlan/metrics.yaml
index 7eaba54..f127dce 100644
--- a/fuchsia/connectivity_wlan/metrics.yaml
+++ b/fuchsia/connectivity_wlan/metrics.yaml
@@ -2873,13 +2873,15 @@
- &connect_reason_dim
dimension: connect_reason
event_codes:
- 1: RetryAfterDisconnectDetected
- 2: RetryAfterFailedConnectAttempt
- 3: FidlConnectRequest
- 4: ProactiveNetworkSwitch
- 5: RegulatoryChangeReconnect
- 6: IdleInterfaceAutoconnect
- 7: NewSavedNetworkAutoconnect
+ 0: RetryAfterDisconnectDetected
+ 1: RetryAfterFailedConnectAttempt
+ 2: FidlConnectRequest
+ 3: ProactiveNetworkSwitch
+ 4: RegulatoryChangeReconnect
+ 5: IdleInterfaceAutoconnect
+ 6: NewSavedNetworkAutoconnect
+ # This event code is obsolete after a bug fix, but cannot be removed. Do not use.
+ 7: DoNotUseRemovedEventCode
max_event_code: 7
reports:
- id: 1