Skip to content

Commit 0627386

Browse files
committed
Addressed code review comments
1 parent 69e63dd commit 0627386

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/darwin/Framework/CHIP/MTRDevice.mm

+4-5
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,6 @@ - (void)_handleSubscriptionEstablished
11771177
{
11781178
os_unfair_lock_lock(&self->_lock);
11791179

1180-
MATTER_LOG_METRIC_END(kMetricMTRDeviceSubscriptionSetup, CHIP_NO_ERROR);
1181-
11821180
// We have completed the subscription work - remove from the subscription pool.
11831181
[self _clearSubscriptionPoolWork];
11841182

@@ -1187,6 +1185,7 @@ - (void)_handleSubscriptionEstablished
11871185
if (HadSubscriptionEstablishedOnce(_internalDeviceState)) {
11881186
[self _changeInternalState:MTRInternalDeviceStateLaterSubscriptionEstablished];
11891187
} else {
1188+
MATTER_LOG_METRIC_END(kMetricMTRDeviceInitialSubscriptionSetup, CHIP_NO_ERROR);
11901189
[self _changeInternalState:MTRInternalDeviceStateInitialSubscriptionEstablished];
11911190
}
11921191

@@ -1227,8 +1226,6 @@ - (void)_handleSubscriptionError:(NSError *)error
12271226
{
12281227
std::lock_guard lock(_lock);
12291228

1230-
MATTER_LOG_METRIC_END(kMetricMTRDeviceSubscriptionSetup, [MTRError errorToCHIPErrorCode:error]);
1231-
12321229
[self _changeInternalState:MTRInternalDeviceStateUnsubscribed];
12331230
_unreportedEvents = nil;
12341231

@@ -2345,7 +2342,9 @@ - (void)_setupSubscriptionWithReason:(NSString *)reason
23452342
});
23462343
}
23472344

2348-
MATTER_LOG_METRIC_BEGIN(kMetricMTRDeviceSubscriptionSetup);
2345+
// This marks begin of initial subscription to the device (before CASE is established). The end is only marked after successfully setting
2346+
// up the subscription since it is always retried as long as the MTRDevice is kept running.
2347+
MATTER_LOG_METRIC_BEGIN(kMetricMTRDeviceInitialSubscriptionSetup);
23492348

23502349
// Call directlyGetSessionForNode because the subscription setup already goes through the subscription pool queue
23512350
[_deviceController

src/darwin/Framework/CHIP/MTRMetricKeys.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ constexpr Tracing::MetricKey kMetricBLEDevicesRemoved = "dwnfw_ble_devices_remov
8888
// Unexpected C quality attribute update outside of priming
8989
constexpr Tracing::MetricKey kMetricUnexpectedCQualityUpdate = "dwnpm_bad_c_attr_update";
9090

91-
// Subscription setup from darwin MTRDevice
92-
constexpr Tracing::MetricKey kMetricMTRDeviceSubscriptionSetup = "dwnpm_dev_subscription_setup";
91+
// Setup from darwin MTRDevice for initial subscrption to a device
92+
constexpr Tracing::MetricKey kMetricMTRDeviceInitialSubscriptionSetup = "dwnpm_dev_initial_subscription_setup";
9393

9494
} // namespace DarwinFramework
9595
} // namespace Tracing

0 commit comments

Comments
 (0)