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

[ASDataController] Add event logging for transaction queue flush duration #trivial #334

Merged
merged 4 commits into from
Jun 21, 2017
Merged
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions Source/Details/ASDataController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#import <AsyncDisplayKit/ASDataController.h>

#import <AsyncDisplayKit/_ASHierarchyChangeSet.h>
#import <AsyncDisplayKit/_ASScopeTimer.h>
#import <AsyncDisplayKit/ASAssert.h>
#import <AsyncDisplayKit/ASCellNode.h>
#import <AsyncDisplayKit/ASCollectionElement.h>
Expand Down Expand Up @@ -485,7 +486,11 @@ - (void)updateWithChangeSet:(_ASHierarchyChangeSet *)changeSet
_initialReloadDataHasBeenCalled = YES;
}

dispatch_group_wait(_editingTransactionGroup, DISPATCH_TIME_FOREVER);
NSTimeInterval transactionQueueFlushDuration;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an initialization, = 0.0f; This would be initialized to 0 automatically if an instance variable, but in this case it's technically needed.

{
ASDN::ScopeTimer t(transactionQueueFlushDuration);
dispatch_group_wait(_editingTransactionGroup, DISPATCH_TIME_FOREVER);
}

// If the initial reloadData has not been called, just bail because we don't have our old data source counts.
// See ASUICollectionViewTests.testThatIssuingAnUpdateBeforeInitialReloadIsUnacceptable
Expand All @@ -498,7 +503,7 @@ - (void)updateWithChangeSet:(_ASHierarchyChangeSet *)changeSet
[self invalidateDataSourceItemCounts];

// Log events
ASDataControllerLogEvent(self, @"triggeredUpdate: %@", changeSet);
ASDataControllerLogEvent(self, @"triggeredUpdate (waited on editing queue for %@ms): %@", transactionQueueFlushDuration * 1000, changeSet);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change %@ms to %fms

#if ASEVENTLOG_ENABLE
NSString *changeSetDescription = ASObjectDescriptionMakeTiny(changeSet);
[changeSet addCompletionHandler:^(BOOL finished) {
Expand Down