MXProfiles: Track time to display a message from its notification

This commit is contained in:
manuroe
2020-11-11 22:49:46 +01:00
parent 16628bd546
commit a58d5123a0
4 changed files with 31 additions and 0 deletions
+18
View File
@@ -204,6 +204,9 @@
// Formatted body parser for events
FormattedBodyParser *formattedBodyParser;
// Time to display notification content in the timeline
MXTaskProfile *notificationTaskProfile;
}
@property (nonatomic, weak) IBOutlet UIView *overlayContainerView;
@@ -500,6 +503,9 @@
[self startActivityIndicator];
[self.roomDataSource reload];
[LegacyAppDelegate theDelegate].lastNavigatedRoomIdFromPush = nil;
notificationTaskProfile = [MXSDKOptions.sharedInstance.profiler startMeasuringTaskWithName:AnalyticsNoficationsTimeToDisplayContent
category:AnalyticsNoficationsCategory];
}
}
@@ -842,6 +848,18 @@
self.updateRoomReadMarker = NO;
}
- (void)stopActivityIndicator
{
if (notificationTaskProfile)
{
// Consider here we have displayed the message corresponding to the notification
[MXSDKOptions.sharedInstance.profiler stopMeasuringTaskWithProfile:notificationTaskProfile];
notificationTaskProfile = nil;
}
[super stopActivityIndicator];
}
- (void)displayRoom:(MXKRoomDataSource *)dataSource
{
// Remove potential preview Data