Permalink
Browse files

Implement recording continuation

It is now possible to continue a previous recording in the profiler
Remove push/pop group API
Each document now has multiple recordings
  • Loading branch information...
LeoNatan committed Aug 29, 2018
1 parent aa7e758 commit 89a285515e0264b8207745a41934d5d6ee1999c7
Showing with 380 additions and 322 deletions.
  1. +1 −1 DetoxInstruments/DetoxInstruments.xcodeproj/project.pbxproj
  2. +9 −5 DetoxInstruments/DetoxInstruments/Controllers/DTXInspectorContentController.m
  3. +11 −10 DetoxInstruments/DetoxInstruments/Controllers/DTXPlotAreaContentController.m
  4. +4 −2 DetoxInstruments/DetoxInstruments/Controllers/DTXPlotDetailSplitViewController.m
  5. +3 −11 DetoxInstruments/DetoxInstruments/DTXWindowController.m
  6. +12 −11 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXDetailDataProvider.m
  7. +2 −2 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXFilteredDataProvider.m
  8. +4 −4 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXLogDataProvider.m
  9. +3 −2 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSampleAggregatorProxy.h
  10. +9 −7 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSampleAggregatorProxy.m
  11. +1 −1 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSampleContainerProxy.h
  12. +1 −1 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSampleGroupProxy.h
  13. +9 −8 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSampleGroupProxy.m
  14. +1 −1 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostCategoryProxy.h
  15. +25 −4 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostCategoryProxy.m
  16. +2 −2 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostDataProvider.m
  17. +1 −1 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostNameProxy.h
  18. +23 −2 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostNameProxy.m
  19. +1 −1 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostRootProxy.h
  20. +3 −3 DetoxInstruments/DetoxInstruments/DetailControllers/DetailDataProviders/DTXSignpostRootProxy.m
  21. +5 −1 DetoxInstruments/DetoxInstruments/Document/DTXRecordingDocument.h
  22. +32 −14 DetoxInstruments/DetoxInstruments/Document/DTXRecordingDocument.m
  23. +2 −2 DetoxInstruments/DetoxInstruments/Info.plist
  24. +3 −3 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXCPUInspectorDataProvider.m
  25. +3 −3 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXDiskInspectorDataProvider.m
  26. +2 −2 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXEventInspectorDataProvider.m
  27. +1 −1 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXFPSInspectorDataProvider.m
  28. +3 −3 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXInspectorDataProvider.m
  29. +1 −1 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXLogLineInspectorDataProvider.m
  30. +1 −1 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXMemoryInspectorDataProvider.m
  31. +2 −2 DetoxInstruments/DetoxInstruments/InspectorDataProviders/DTXNetworkInspectorDataProvider.m
  32. +1 −1 ...ments/DetoxInstruments/InspectorDataProviders/ReactNative/DTXRNBridgeCallsInspectorDataProvider.m
  33. +1 −1 ...uments/DetoxInstruments/InspectorDataProviders/ReactNative/DTXRNBridgeDataInspectorDataProvider.m
  34. +1 −1 DetoxInstruments/DetoxInstruments/InspectorDataProviders/ReactNative/DTXRNCPUInspectorDataProvider.m
  35. +0 −38 DetoxInstruments/DetoxInstruments/Main.storyboard
  36. +1 −1 DetoxInstruments/DetoxInstruments/Model/DTXNetworkSample+UIExtensions.h
  37. +2 −2 DetoxInstruments/DetoxInstruments/Model/DTXNetworkSample+UIExtensions.m
  38. +0 −2 DetoxInstruments/DetoxInstruments/Model/DTXRecording+UIExtensions.h
  39. +0 −18 DetoxInstruments/DetoxInstruments/Model/DTXRecording+UIExtensions.m
  40. +0 −2 DetoxInstruments/DetoxInstruments/Model/DTXSampleGroup+UIExtensions.h
  41. +0 −10 DetoxInstruments/DetoxInstruments/Model/DTXSampleGroup+UIExtensions.m
  42. +1 −1 DetoxInstruments/DetoxInstruments/Model/DTXSignpostSample+UIExtensions.h
  43. +2 −2 DetoxInstruments/DetoxInstruments/Model/DTXSignpostSample+UIExtensions.m
  44. +1 −1 DetoxInstruments/DetoxInstruments/PlotControllers/CorePlotAdditions/DTXEventsPlotController.m
  45. +1 −1 DetoxInstruments/DetoxInstruments/PlotControllers/DTXAxisHeaderPlotController.m
  46. +1 −1 DetoxInstruments/DetoxInstruments/PlotControllers/DTXCompactNetworkRequestsPlotController.m
  47. +6 −6 DetoxInstruments/DetoxInstruments/PlotControllers/DTXIntervalSamplePlotController.m
  48. +2 −2 DetoxInstruments/DetoxInstruments/PlotControllers/DTXPerformanceSamplePlotController.m
  49. +3 −7 DetoxInstruments/DetoxInstruments/PlotControllers/DTXSamplePlotController.m
  50. +1 −1 DetoxInstruments/Sparkle
  51. BIN Documentation/Example Recording/example.dtxprof/_dtx_recording.sqlite
  52. +9 −1 Profiler/DTXProfiler/DTXProfiler.h
  53. +117 −16 Profiler/DTXProfiler/DTXProfiler.m
  54. +0 −27 Profiler/DTXProfiler/DTXProfilerAPI.h
  55. +0 −22 Profiler/DTXProfiler/DTXProfilerAPI.m
  56. +1 −1 Profiler/DTXProfiler/DTXProfilingConfiguration.h
  57. +2 −2 Profiler/DTXProfiler/Info.plist
  58. +3 −2 Profiler/DTXProfiler/Model/DTXInstruments.xcdatamodeld/DTXInstruments.xcdatamodel/contents
  59. +3 −0 Profiler/DTXProfiler/Model/DTXRecording+Additions.h
  60. +19 −0 Profiler/DTXProfiler/Model/DTXRecording+Additions.m
  61. +3 −3 Profiler/DTXProfiler/PerformanceProfiling/DTXPerformanceSampler.m
  62. +5 −2 Profiler/DTXProfiler/Polling/DTXPollingManager.m
  63. +1 −1 Profiler/DTXProfiler/RemoteProfiler/DTXRemoteProfiler.m
  64. +0 −27 ProfilerShim/DTXProfilerShim/DTXProfilerAPI.h
  65. +0 −8 ProfilerShim/DTXProfilerShim/Impl.m
  66. +13 −0 SampleApps/StressTestApp/StressTestApp/main.m
@@ -951,8 +951,8 @@
39782CDA1FC590DA0034D70A /* DTXInstrumentsModel.h */,
39782CD91FC590DA0034D70A /* DTXRecording+Additions.h */,
39782CD81FC590DA0034D70A /* DTXRecording+Additions.m */,
39782CD51FC590D90034D70A /* DTXSample+Additions.m */,
39782CD71FC590DA0034D70A /* DTXSample+Additions.h */,
39782CD51FC590D90034D70A /* DTXSample+Additions.m */,
39782CD61FC590D90034D70A /* NSManagedObject+Additions.h */,
39782CD41FC590D90034D70A /* NSManagedObject+Additions.m */,
393973D71EDC1BFD0064D4C8 /* DTXInstrumentsModelUIExtensions.h */,
@@ -61,7 +61,7 @@ - (void)_documentStateDidChange:(NSNotification*)note
{
_recordingDescriptionDataSource = nil;
if(self.document.recording == nil)
if(self.document.recordings.count == 0)
{
return;
}
@@ -105,7 +105,7 @@ - (void)_prepareRecordingDescriptionIfNeeded
return;
}
DTXRecording* recording = [self.document recording];
DTXRecording* recording = self.document.firstRecording;
DTXProfilingConfiguration* configuration;
if(recording.profilingConfiguration)
{
@@ -135,13 +135,17 @@ - (void)_prepareRecordingDescriptionIfNeeded
[content addObject:[DTXInspectorContentRow contentRowWithNewLine]];
if(self.document.recordings.count > 1)
{
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Number of Recordings", @"") description:[NSString stringWithFormat:@"%lu", self.document.recordings.count]]];
}
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Start Time", @"") description:[NSDateFormatter localizedStringFromDate:recording.startTimestamp dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterLongStyle]]];
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"End Time", @"") description:[NSDateFormatter localizedStringFromDate:recording.endTimestamp dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterLongStyle]]];
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"End Time", @"") description:[NSDateFormatter localizedStringFromDate:self.document.lastRecording.endTimestamp dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterLongStyle]]];
NSDateComponentsFormatter* ivFormatter = [NSDateComponentsFormatter new];
ivFormatter.unitsStyle = NSDateComponentsFormatterUnitsStyleFull;
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Duration", @"") description:[ivFormatter stringFromDate:recording.startTimestamp toDate:recording.endTimestamp]]];
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Duration", @"") description:[ivFormatter stringFromDate:recording.startTimestamp toDate:self.document.lastRecording.endTimestamp]]];
recordingInfo.content = content;
@@ -160,7 +164,7 @@ - (void)_prepareRecordingDescriptionIfNeeded
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Symbolicate Stack Traces", @"") description:__DTXStringFromBoolean(configuration.symbolicateStackTraces)]];
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Record Log Output", @"") description:__DTXStringFromBoolean(configuration.recordLogOutput)]];
[content addObject:[DTXInspectorContentRow contentRowWithNewLine]];
// [content addObject:[DTXInspectorContentRow contentRowWithNewLine]];
[content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Profile React Native", @"") description:__DTXStringFromBoolean(configuration.profileReactNative)]];
// [content addObject:[DTXInspectorContentRow contentRowWithTitle:NSLocalizedString(@"Collect Java Script Stack Traces", @"") description:__DTXStringFromBoolean(configuration.collectJavaScriptStackTraces)]];
@@ -22,6 +22,7 @@
#import "DTXEventsPlotController.h"
#import "DTXRecording+UIExtensions.h"
#import "DTXSignpostSample+UIExtensions.h"
#import "DTXNetworkSample+UIExtensions.h"
#import "DTXPlotControllerPickerController.h"
#import "DTXLayerView.h"
@@ -86,7 +87,7 @@ - (void)_documentStateDidChangeNotification:(NSNotification*)note
{
_plotGroup = nil;
if(self.document.recording == nil)
if(self.document.recordings.count == 0)
{
return;
}
@@ -115,13 +116,13 @@ - (void)_reloadPlotGroupIfNeeded
if(self.document.documentState < DTXRecordingDocumentStateLiveRecordingFinished)
{
[_plotGroup setGlobalStartTimestamp:self.document.recording.defactoStartTimestamp endTimestamp:[NSDate distantFuture]];
[_plotGroup setLocalStartTimestamp:self.document.recording.defactoStartTimestamp endTimestamp:[self.document.recording.defactoStartTimestamp dateByAddingTimeInterval:120]];
[_plotGroup setGlobalStartTimestamp:self.document.firstRecording.defactoStartTimestamp endTimestamp:[NSDate distantFuture]];
[_plotGroup setLocalStartTimestamp:self.document.firstRecording.defactoStartTimestamp endTimestamp:[self.document.firstRecording.defactoStartTimestamp dateByAddingTimeInterval:120]];
}
else
{
[_plotGroup setGlobalStartTimestamp:self.document.recording.defactoStartTimestamp endTimestamp:self.document.recording.defactoEndTimestamp];
[_plotGroup setLocalStartTimestamp:self.document.recording.defactoStartTimestamp endTimestamp:self.document.recording.defactoEndTimestamp];
[_plotGroup setGlobalStartTimestamp:self.document.firstRecording.defactoStartTimestamp endTimestamp:self.document.lastRecording.defactoEndTimestamp];
[_plotGroup setLocalStartTimestamp:self.document.firstRecording.defactoStartTimestamp endTimestamp:self.document.lastRecording.defactoEndTimestamp];
}
_tableView.intercellSpacing = NSMakeSize(1, 0);
@@ -137,7 +138,7 @@ - (void)_reloadPlotGroupIfNeeded
NSFetchRequest* fr = [DTXThreadInfo fetchRequest];
fr.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"number" ascending:YES]];
_threadsObserver = [[NSFetchedResultsController alloc] initWithFetchRequest:fr managedObjectContext:self.document.recording.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
_threadsObserver = [[NSFetchedResultsController alloc] initWithFetchRequest:fr managedObjectContext:self.document.firstRecording.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
_threadsObserver.delegate = self;
[_threadsObserver performFetch:nil];
@@ -153,17 +154,17 @@ - (void)_reloadPlotGroupIfNeeded
[_plotGroup addPlotController:[[DTXFPSPlotController alloc] initWithDocument:self.document]];
[_plotGroup addPlotController:[[DTXDiskReadWritesPlotController alloc] initWithDocument:self.document]];
if((self.document.recording.dtx_profilingConfiguration == nil || self.document.recording.dtx_profilingConfiguration.recordNetwork == YES) && (self.document.documentState <= DTXRecordingDocumentStateLiveRecordingFinished || [DTXSignpostSample hasSignpostSamplesInRecording:self.document.recording]))
if(self.document.documentState <= DTXRecordingDocumentStateLiveRecordingFinished || [DTXNetworkSample hasNetworkSamplesInManagedObjectContext:self.document.firstRecording.managedObjectContext])
{
[_plotGroup addPlotController:[[DTXCompactNetworkRequestsPlotController alloc] initWithDocument:self.document]];
}
if(self.document.documentState <= DTXRecordingDocumentStateLiveRecordingFinished || [DTXSignpostSample hasSignpostSamplesInRecording:self.document.recording])
if(self.document.documentState <= DTXRecordingDocumentStateLiveRecordingFinished || [DTXSignpostSample hasSignpostSamplesInManagedObjectContext:self.document.firstRecording.managedObjectContext])
{
[_plotGroup addPlotController:[[DTXEventsPlotController alloc] initWithDocument:self.document]];
}
if(self.document.recording.hasReactNative && self.document.recording.dtx_profilingConfiguration.profileReactNative)
if(self.document.firstRecording.hasReactNative && self.document.firstRecording.dtx_profilingConfiguration.profileReactNative)
{
[_plotGroup addPlotController:[[DTXRNCPUUsagePlotController alloc] initWithDocument:self.document]];
[_plotGroup addPlotController:[[DTXRNBridgeCountersPlotController alloc] initWithDocument:self.document]];
@@ -242,13 +242,15 @@ - (IBAction)_export:(id)sender
NSData* data = nil;
NSError* error = nil;
//TODO: Fix this
if(_formatPopupButton.selectedTag == 0)
{
data = [NSPropertyListSerialization dataWithPropertyList:[((DTXRecordingDocument*)self.document).recording dictionaryRepresentationForPropertyList] format:NSPropertyListBinaryFormat_v1_0 options:0 error:&error];
// data = [NSPropertyListSerialization dataWithPropertyList:[((DTXRecordingDocument*)self.document).recording dictionaryRepresentationForPropertyList] format:NSPropertyListBinaryFormat_v1_0 options:0 error:&error];
}
else
{
data = [NSJSONSerialization dataWithJSONObject:[((DTXRecordingDocument*)self.document).recording dictionaryRepresentationForJSON] options:NSJSONWritingPrettyPrinted error:&error];
// data = [NSJSONSerialization dataWithJSONObject:[((DTXRecordingDocument*)self.document).recording dictionaryRepresentationForJSON] options:NSJSONWritingPrettyPrinted error:&error];
}
if(data != nil)
@@ -29,8 +29,6 @@ @interface DTXWindowController () <DTXPlotAreaContentControllerDelegate, DTXDeta
__weak IBOutlet NSButton* _stopRecordingButton;
__weak IBOutlet NSButton* _flagButton;
__weak IBOutlet NSButton* _pushGroupButton;
__weak IBOutlet NSButton* _popGroupButton;
DTXPlotDetailSplitViewController* _plotDetailsSplitViewController;
DTXDetailInspectorSplitViewController* _detailInspectorSplitViewController;
@@ -136,13 +134,13 @@ - (void)_fixUpTitle
DTXRecordingDocument* document = (DTXRecordingDocument*)self.document;
if(document.documentState >= DTXRecordingDocumentStateLiveRecordingFinished && document.recording.startTimestamp && document.recording.endTimestamp)
if(document.documentState >= DTXRecordingDocumentStateLiveRecordingFinished && document.firstRecording.startTimestamp && document.lastRecording.endTimestamp)
{
_titleTextField.stringValue = [NSString stringWithFormat:@"%@ | %@", document.recording.appName, [ivFormatter stringFromDate:document.recording.startTimestamp toDate:document.recording.endTimestamp]];
_titleTextField.stringValue = [NSString stringWithFormat:@"%@ | %@", document.firstRecording.appName, [ivFormatter stringFromDate:document.firstRecording.startTimestamp toDate:document.lastRecording.endTimestamp]];
}
else if(document.documentState == DTXRecordingDocumentStateLiveRecording)
{
_titleTextField.stringValue = [NSString stringWithFormat:@"%@ | %@", document.recording.appName, NSLocalizedString(@"Recording...", @"")];
_titleTextField.stringValue = [NSString stringWithFormat:@"%@ | %@", document.firstRecording.appName, NSLocalizedString(@"Recording...", @"")];
}
else
{
@@ -162,12 +160,6 @@ - (void)_fixUpRecordingButtons
_flagButton.enabled = [(DTXRecordingDocument*)self.document documentState] == DTXRecordingDocumentStateLiveRecording;
_flagButton.hidden = !_flagButton.enabled;
_pushGroupButton.enabled = 0.0; //[(DTXRecordingDocument*)self.document documentState] == DTXRecordingDocumentStateLiveRecording;
_pushGroupButton.hidden = !_pushGroupButton.enabled;
_popGroupButton.enabled = _popGroupButton.hidden = 0.0; //[(DTXRecordingDocument*)self.document documentState] == DTXRecordingDocumentStateLiveRecording;
_popGroupButton.hidden = !_popGroupButton.enabled;
}
- (IBAction)_stopRecordingButtonPressed:(id)sender
@@ -18,6 +18,7 @@
#import "DTXFilteredDataProvider.h"
#import "NSView+UIAdditions.h"
#import "DTXSampleAggregatorProxy.h"
#import "DTXRecording+UIExtensions.h"
const CGFloat DTXAutomaticColumnWidth = -1.0;
@@ -179,7 +180,7 @@ - (void)setupContainerProxies
- (DTXSampleContainerProxy*)rootSampleContainerProxy
{
return [[DTXSampleGroupProxy alloc] initWithSampleGroup:_document.recording.rootSampleGroup sampleTypes:self.sampleTypes outlineView:_managedOutlineView];
return [[DTXSampleGroupProxy alloc] initWithSampleTypes:self.sampleTypes outlineView:_managedOutlineView managedObjectContext:_document.firstRecording.managedObjectContext];
}
- (BOOL)showsHeaderView
@@ -288,13 +289,13 @@ - (void)_updateRowView:(DTXTableRowView*)rowView withItem:(id)item
rowView.userNotifyColor = [self backgroundRowColorForItem:item];
[rowView setUserNotifyTooltip:[self statusTooltipforItem:item]];
BOOL hasParentGroup = [item respondsToSelector:@selector(parentGroup)];
if(hasParentGroup && [rowView.userNotifyColor isEqualTo:NSColor.controlBackgroundColor] && [item parentGroup] != _document.recording.rootSampleGroup)
{
CGFloat fraction = MIN(0.03 + (DTXDepthOfSample(item, _document.recording.rootSampleGroup) / 30.0), 0.3);
rowView.userNotifyColor = [NSColor.controlBackgroundColor interpolateToValue:[NSColor colorWithRed:150.0f/255.0f green:194.0f/255.0f blue:254.0f/255.0f alpha:1.0] progress:fraction];
}
// BOOL hasParentGroup = [item respondsToSelector:@selector(parentGroup)];
// if(hasParentGroup && [rowView.userNotifyColor isEqualTo:NSColor.controlBackgroundColor] && [item parentGroup] != _document.recording.rootSampleGroup)
// {
// CGFloat fraction = MIN(0.03 + (DTXDepthOfSample(item, _document.recording.rootSampleGroup) / 30.0), 0.3);
//
// rowView.userNotifyColor = [NSColor.controlBackgroundColor interpolateToValue:[NSColor colorWithRed:150.0f/255.0f green:194.0f/255.0f blue:254.0f/255.0f alpha:1.0] progress:fraction];
// }
}
}
@@ -311,7 +312,7 @@ - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTable
{
NSTableCellView* cellView = [outlineView makeViewWithIdentifier:@"DTXTextCell" owner:nil];
NSDate* timestamp = [(DTXSample*)item timestamp];
NSTimeInterval ti = [timestamp timeIntervalSinceReferenceDate] - [_document.recording.startTimestamp timeIntervalSinceReferenceDate];
NSTimeInterval ti = [timestamp timeIntervalSinceReferenceDate] - [_document.firstRecording.startTimestamp timeIntervalSinceReferenceDate];
cellView.textField.stringValue = [[NSFormatter dtx_secondsFormatter] stringForObjectValue:@(ti)];
cellView.textField.font = [self _monospacedNumbersFontForFont:cellView.textField.font bold:NO];
@@ -418,9 +419,9 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
DTXSampleContainerProxy* groupProxy = item;
NSDate* groupCloseTimestamp = groupProxy.closeTimestamp ?: _document.recording.endTimestamp;
NSDate* groupCloseTimestamp = groupProxy.closeTimestamp ?: [item recording].endTimestamp;
CPTPlotRange* groupRange = [CPTPlotRange plotRangeWithLocation:@(groupProxy.timestamp.timeIntervalSinceReferenceDate - _document.recording.startTimestamp.timeIntervalSinceReferenceDate) length:@(groupCloseTimestamp.timeIntervalSinceReferenceDate - groupProxy.timestamp.timeIntervalSinceReferenceDate)];
CPTPlotRange* groupRange = [CPTPlotRange plotRangeWithLocation:@(groupProxy.timestamp.timeIntervalSinceReferenceDate - _document.firstRecording.defactoStartTimestamp.timeIntervalSinceReferenceDate) length:@(groupCloseTimestamp.timeIntervalSinceReferenceDate - groupProxy.timestamp.timeIntervalSinceReferenceDate)];
[_plotController highlightRange:groupRange];
}
}
@@ -44,10 +44,10 @@ - (void)filterSamplesWithPredicate:(NSPredicate *)predicate
NSFetchRequest* fr = [NSFetchRequest new];
Class cls = [DTXSample classFromSampleType:self.sampleTypes.firstObject.unsignedIntegerValue];
NSString* entityName = [NSStringFromClass(cls) substringFromIndex:3];
fr.entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:_document.recording.managedObjectContext];
fr.entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:_document.firstRecording.managedObjectContext];
fr.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES]];
_frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fr managedObjectContext:_document.recording.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
_frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fr managedObjectContext:_document.firstRecording.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
_frc.delegate = self;
}
@@ -72,7 +72,7 @@ - (void)setManagedTableView:(NSTableView *)managedTableView
[_managedTableView layoutSubtreeIfNeeded];
if(_document.recording != nil)
if(_document.recordings.count != 0)
{
[self _prepareLogData];
}
@@ -88,7 +88,7 @@ - (void)setManagedTableView:(NSTableView *)managedTableView
- (void)_documentStateDidChangeNotification:(NSNotification*)note
{
if(_document.recording != nil)
if(_document.recordings.count != 0)
{
[self _prepareLogData];
}
@@ -104,7 +104,7 @@ - (void)_prepareLogData
NSFetchRequest* fr = [DTXLogSample fetchRequest];
fr.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES]];
_frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fr managedObjectContext:_document.recording.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
_frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fr managedObjectContext:_document.firstRecording.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
_frc.delegate = self;
[_frc performFetch:NULL];
@@ -153,7 +153,7 @@ - (void)scrollToTimestamp:(NSDate*)timestamp
fr.fetchLimit = 1;
fr.predicate = [NSPredicate predicateWithFormat:@"timestamp < %@", timestamp];
DTXLogSample* foundSample = [_document.recording.managedObjectContext executeFetchRequest:fr error:NULL].firstObject;
DTXLogSample* foundSample = [_document.firstRecording.managedObjectContext executeFetchRequest:fr error:NULL].firstObject;
if(foundSample == nil)
{
@@ -8,14 +8,15 @@
#import "DTXSampleContainerProxy.h"
#import "DTXRecording+Additions.h"
@import CoreData;
@interface DTXSampleAggregatorProxy : DTXSampleContainerProxy
@property (nonatomic, strong, readonly) NSString* keyPath;
@property (nonatomic, strong, readonly) DTXRecording* recording;
@property (nonatomic, strong, readonly) NSManagedObjectContext* managedObjectContext;
@property (nonatomic, strong, readonly) Class sampleClass;
@property (nonatomic, strong, readonly) NSPredicate* predicateForAggregator;
- (instancetype)initWithKeyPath:(NSString*)keyPath isRoot:(BOOL)root recording:(DTXRecording*)recording outlineView:(NSOutlineView*)outlineView;
- (instancetype)initWithKeyPath:(NSString*)keyPath isRoot:(BOOL)root managedObjectContext:(NSManagedObjectContext*)managedObjectContext outlineView:(NSOutlineView*)outlineView;
@end
Oops, something went wrong.

0 comments on commit 89a2855

Please sign in to comment.