Skip to content

Commit 5b87a95

Browse files
committed
Clarify constant name per review comment
1 parent 30e8c8f commit 5b87a95

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm

+11-11
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <lib/support/SafeInt.h>
2828

2929
// Log error each time sync storage takes longer than this threshold
30-
#define SYNC_OPERATION_DURATION_LOG_THRESHOLD (2.0)
30+
#define SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS (2.0)
3131

3232
// FIXME: Are these good key strings? https://github.com/project-chip/connectedhomeip/issues/28973
3333
static NSString * sResumptionNodeListKey = @"caseResumptionNodeList";
@@ -151,7 +151,7 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller
151151
}
152152
});
153153
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
154-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
154+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
155155
MTR_LOG_ERROR("MTRDeviceControllerDataStore init took %0.6lf seconds to read from storage", syncDuration);
156156
}
157157
if (resumptionNodeList != nil) {
@@ -192,7 +192,7 @@ - (void)fetchAttributeDataForAllDevices:(MTRDeviceControllerDataStoreClusterData
192192
}
193193
});
194194
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
195-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
195+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
196196
MTR_LOG_ERROR("MTRDeviceControllerDataStore fetchAttributeDataForAllDevices took %0.6lf seconds to read from storage", syncDuration);
197197
}
198198

@@ -256,7 +256,7 @@ - (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo
256256
sharingType:MTRStorageSharingTypeNotShared];
257257
});
258258
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
259-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
259+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
260260
MTR_LOG_ERROR("MTRDeviceControllerDataStore storeResumptionInfo took %0.6lf seconds to store to storage", syncDuration);
261261
}
262262
}
@@ -304,7 +304,7 @@ - (void)_clearResumptionInfoForNodeID:(NSNumber *)nodeID controller:(MTRDeviceCo
304304
sharingType:MTRStorageSharingTypeNotShared];
305305
});
306306
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
307-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
307+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
308308
MTR_LOG_ERROR("MTRDeviceControllerDataStore _clearResumptionInfoForNodeID took %0.6lf seconds to remove from storage", syncDuration);
309309
}
310310
}
@@ -325,7 +325,7 @@ - (CHIP_ERROR)storeLastLocallyUsedNOC:(MTRCertificateTLVBytes)noc
325325
sharingType:MTRStorageSharingTypeNotShared];
326326
});
327327
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
328-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
328+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
329329
MTR_LOG_ERROR("MTRDeviceControllerDataStore storeLastLocallyUsedNOC took %0.6lf seconds to store to storage", syncDuration);
330330
}
331331
return ok ? CHIP_NO_ERROR : CHIP_ERROR_PERSISTED_STORAGE_FAILED;
@@ -347,7 +347,7 @@ - (MTRCertificateTLVBytes _Nullable)fetchLastLocallyUsedNOC
347347
}
348348
});
349349
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
350-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
350+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
351351
MTR_LOG_ERROR("MTRDeviceControllerDataStore fetchLastLocallyUsedNOC took %0.6lf seconds to read from storage", syncDuration);
352352
}
353353

@@ -383,7 +383,7 @@ - (nullable MTRCASESessionResumptionInfo *)_findResumptionInfoWithKey:(nullable
383383
}
384384
});
385385
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
386-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
386+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
387387
MTR_LOG_ERROR("MTRDeviceControllerDataStore _findResumptionInfoWithKey took %0.6lf seconds to read from storage", syncDuration);
388388
}
389389

@@ -964,7 +964,7 @@ - (void)clearAllStoredClusterData
964964
}
965965
});
966966
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
967-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
967+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
968968
MTR_LOG_ERROR("MTRDeviceControllerDataStore getStoredClusterDataForNodeID took %0.6lf seconds to read from storage", syncDuration);
969969
}
970970

@@ -982,7 +982,7 @@ - (nullable MTRDeviceClusterData *)getStoredClusterDataForNodeID:(NSNumber *)nod
982982
clusterDataToReturn = [self _fetchClusterDataForNodeID:nodeID endpointID:endpointID clusterID:clusterID];
983983
});
984984
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
985-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
985+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
986986
MTR_LOG_ERROR("MTRDeviceControllerDataStore getStoredClusterDataForNodeID took %0.6lf seconds to read from storage", syncDuration);
987987
}
988988
return clusterDataToReturn;
@@ -1254,7 +1254,7 @@ - (NSString *)_deviceDataKeyForNodeID:(NSNumber *)nodeID
12541254
deviceData = dictionary;
12551255
});
12561256
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow];
1257-
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD) {
1257+
if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS) {
12581258
MTR_LOG_ERROR("MTRDeviceControllerDataStore getStoredDeviceDataForNodeID took %0.6lf seconds to read from storage", syncDuration);
12591259
}
12601260
return deviceData;

0 commit comments

Comments
 (0)