Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metrics] Fixed incorrect key values for metrics in darwin #34271

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
@@ -1101,7 +1101,7 @@ - (NSData * _Nullable)attestationChallengeForDeviceID:(NSNumber *)deviceID
chip::CommissioneeDeviceProxy * deviceProxy;

auto errorCode = CHIP_NO_ERROR;
MATTER_LOG_METRIC_SCOPE(kMetricPASEVerifierForSetupCode, errorCode);
MATTER_LOG_METRIC_SCOPE(kMetricAttestationChallengeForDevice, errorCode);

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

__block CHIP_ERROR errorCode = CHIP_NO_ERROR;
MATTER_LOG_METRIC_SCOPE(kMetricOpenPairingWindow, errorCode);

auto block = ^BOOL {
CHIP_ERROR errorCode = CHIP_NO_ERROR;
MATTER_LOG_METRIC_SCOPE(kMetricOpenPairingWindow, errorCode);

errorCode = chip::Controller::AutoCommissioningWindowOpener::OpenBasicCommissioningWindow(
self->_cppCommissioner, deviceID, chip::System::Clock::Seconds16(static_cast<uint16_t>(duration)));
return ![MTRDeviceController checkForError:errorCode logMsg:kErrorOpenPairingWindow error:error];
5 changes: 4 additions & 1 deletion src/darwin/Framework/CHIP/MTRMetricKeys.h
Original file line number Diff line number Diff line change
@@ -61,8 +61,11 @@ constexpr Tracing::MetricKey kMetricDeviceBeingCommissioned = "dwnfw_dev_being_c
// Tracks the request to generate PASE verifier for a given setup code
constexpr Tracing::MetricKey kMetricPASEVerifierForSetupCode = "dwnfw_pase_verifier_for_code";

// Tracks the request to get attestation challenge for a device
constexpr Tracing::MetricKey kMetricAttestationChallengeForDevice = "dwnfw_attestation_challenge_for_device";

// Marks the request to open pairing window
constexpr Tracing::MetricKey kMetricOpenPairingWindow = "dwnfw_pase_verifier_for_code";
constexpr Tracing::MetricKey kMetricOpenPairingWindow = "dwnfw_open_pairing_window";

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