27
27
#include < lib/support/SafeInt.h>
28
28
29
29
// 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 )
31
31
32
32
// FIXME: Are these good key strings? https://github.com/project-chip/connectedhomeip/issues/28973
33
33
static NSString * sResumptionNodeListKey = @" caseResumptionNodeList" ;
@@ -151,7 +151,7 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller
151
151
}
152
152
});
153
153
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
154
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
154
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
155
155
MTR_LOG_ERROR (" MTRDeviceControllerDataStore init took %0.6lf seconds to read from storage" , syncDuration);
156
156
}
157
157
if (resumptionNodeList != nil ) {
@@ -192,7 +192,7 @@ - (void)fetchAttributeDataForAllDevices:(MTRDeviceControllerDataStoreClusterData
192
192
}
193
193
});
194
194
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
195
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
195
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
196
196
MTR_LOG_ERROR (" MTRDeviceControllerDataStore fetchAttributeDataForAllDevices took %0.6lf seconds to read from storage" , syncDuration);
197
197
}
198
198
@@ -256,7 +256,7 @@ - (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo
256
256
sharingType: MTRStorageSharingTypeNotShared];
257
257
});
258
258
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
259
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
259
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
260
260
MTR_LOG_ERROR (" MTRDeviceControllerDataStore storeResumptionInfo took %0.6lf seconds to store to storage" , syncDuration);
261
261
}
262
262
}
@@ -304,7 +304,7 @@ - (void)_clearResumptionInfoForNodeID:(NSNumber *)nodeID controller:(MTRDeviceCo
304
304
sharingType: MTRStorageSharingTypeNotShared];
305
305
});
306
306
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
307
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
307
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
308
308
MTR_LOG_ERROR (" MTRDeviceControllerDataStore _clearResumptionInfoForNodeID took %0.6lf seconds to remove from storage" , syncDuration);
309
309
}
310
310
}
@@ -325,7 +325,7 @@ - (CHIP_ERROR)storeLastLocallyUsedNOC:(MTRCertificateTLVBytes)noc
325
325
sharingType: MTRStorageSharingTypeNotShared];
326
326
});
327
327
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
328
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
328
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
329
329
MTR_LOG_ERROR (" MTRDeviceControllerDataStore storeLastLocallyUsedNOC took %0.6lf seconds to store to storage" , syncDuration);
330
330
}
331
331
return ok ? CHIP_NO_ERROR : CHIP_ERROR_PERSISTED_STORAGE_FAILED;
@@ -347,7 +347,7 @@ - (MTRCertificateTLVBytes _Nullable)fetchLastLocallyUsedNOC
347
347
}
348
348
});
349
349
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
350
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
350
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
351
351
MTR_LOG_ERROR (" MTRDeviceControllerDataStore fetchLastLocallyUsedNOC took %0.6lf seconds to read from storage" , syncDuration);
352
352
}
353
353
@@ -383,7 +383,7 @@ - (nullable MTRCASESessionResumptionInfo *)_findResumptionInfoWithKey:(nullable
383
383
}
384
384
});
385
385
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
386
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
386
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
387
387
MTR_LOG_ERROR (" MTRDeviceControllerDataStore _findResumptionInfoWithKey took %0.6lf seconds to read from storage" , syncDuration);
388
388
}
389
389
@@ -964,7 +964,7 @@ - (void)clearAllStoredClusterData
964
964
}
965
965
});
966
966
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
967
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
967
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
968
968
MTR_LOG_ERROR (" MTRDeviceControllerDataStore getStoredClusterDataForNodeID took %0.6lf seconds to read from storage" , syncDuration);
969
969
}
970
970
@@ -982,7 +982,7 @@ - (nullable MTRDeviceClusterData *)getStoredClusterDataForNodeID:(NSNumber *)nod
982
982
clusterDataToReturn = [self _fetchClusterDataForNodeID: nodeID endpointID: endpointID clusterID: clusterID];
983
983
});
984
984
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
985
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
985
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
986
986
MTR_LOG_ERROR (" MTRDeviceControllerDataStore getStoredClusterDataForNodeID took %0.6lf seconds to read from storage" , syncDuration);
987
987
}
988
988
return clusterDataToReturn;
@@ -1254,7 +1254,7 @@ - (NSString *)_deviceDataKeyForNodeID:(NSNumber *)nodeID
1254
1254
deviceData = dictionary;
1255
1255
});
1256
1256
NSTimeInterval syncDuration = -[startTime timeIntervalSinceNow ];
1257
- if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD ) {
1257
+ if (syncDuration > SYNC_OPERATION_DURATION_LOG_THRESHOLD_SECONDS ) {
1258
1258
MTR_LOG_ERROR (" MTRDeviceControllerDataStore getStoredDeviceDataForNodeID took %0.6lf seconds to read from storage" , syncDuration);
1259
1259
}
1260
1260
return deviceData;
0 commit comments