Skip to content

Commit 76a7b0b

Browse files
authored
[Metrics] Fixed incorrect key values for metrics in darwin (project-chip#34271)
open pairing window metrics was not capturing the metric inside the block
1 parent 521b05f commit 76a7b0b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/darwin/Framework/CHIP/MTRDeviceController.mm

+4-4
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ - (NSData * _Nullable)attestationChallengeForDeviceID:(NSNumber *)deviceID
11131113
chip::CommissioneeDeviceProxy * deviceProxy;
11141114

11151115
auto errorCode = CHIP_NO_ERROR;
1116-
MATTER_LOG_METRIC_SCOPE(kMetricPASEVerifierForSetupCode, errorCode);
1116+
MATTER_LOG_METRIC_SCOPE(kMetricAttestationChallengeForDevice, errorCode);
11171117

11181118
errorCode = self->_cppCommissioner->GetDeviceBeingCommissioned([deviceID unsignedLongLongValue], &deviceProxy);
11191119
VerifyOrReturnValue(![MTRDeviceController checkForError:errorCode logMsg:kErrorGetCommissionee error:nil], nil);
@@ -1885,10 +1885,10 @@ - (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error
18851885
return NO;
18861886
}
18871887

1888-
__block CHIP_ERROR errorCode = CHIP_NO_ERROR;
1889-
MATTER_LOG_METRIC_SCOPE(kMetricOpenPairingWindow, errorCode);
1890-
18911888
auto block = ^BOOL {
1889+
CHIP_ERROR errorCode = CHIP_NO_ERROR;
1890+
MATTER_LOG_METRIC_SCOPE(kMetricOpenPairingWindow, errorCode);
1891+
18921892
errorCode = chip::Controller::AutoCommissioningWindowOpener::OpenBasicCommissioningWindow(
18931893
self->_cppCommissioner, deviceID, chip::System::Clock::Seconds16(static_cast<uint16_t>(duration)));
18941894
return ![MTRDeviceController checkForError:errorCode logMsg:kErrorOpenPairingWindow error:error];

src/darwin/Framework/CHIP/MTRMetricKeys.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ constexpr Tracing::MetricKey kMetricDeviceBeingCommissioned = "dwnfw_dev_being_c
6161
// Tracks the request to generate PASE verifier for a given setup code
6262
constexpr Tracing::MetricKey kMetricPASEVerifierForSetupCode = "dwnfw_pase_verifier_for_code";
6363

64+
// Tracks the request to get attestation challenge for a device
65+
constexpr Tracing::MetricKey kMetricAttestationChallengeForDevice = "dwnfw_attestation_challenge_for_device";
66+
6467
// Marks the request to open pairing window
65-
constexpr Tracing::MetricKey kMetricOpenPairingWindow = "dwnfw_pase_verifier_for_code";
68+
constexpr Tracing::MetricKey kMetricOpenPairingWindow = "dwnfw_open_pairing_window";
6669

6770
// Device Vendor ID
6871
constexpr Tracing::MetricKey kMetricDeviceVendorID = "dwnfw_device_vendor_id";

0 commit comments

Comments
 (0)