void FProfilerManager::ProfilerSession_OnCaptureFileProcessed( const FGuid ProfilerInstanceID ) { const FProfilerSessionRef* ProfilerSession = FindSessionInstance( ProfilerInstanceID ); if( ProfilerSession && ProfilerWindow.IsValid()) { GetProfilerWindow()->UpdateEventGraph( ProfilerInstanceID, (*ProfilerSession)->GetEventGraphDataAverage(), (*ProfilerSession)->GetEventGraphDataMaximum(), true ); bHasCaptureFileFullyProcessed = true; } }
void FProfilerManager::ProfilerClient_OnMetaDataUpdated( const FGuid& InstanceID ) { const FProfilerSessionRef* ProfilerSession = FindSessionInstance( InstanceID ); if( ProfilerSession && ProfilerWindow.IsValid()) { (*ProfilerSession)->UpdateMetadata( ProfilerClient->GetStatMetaData( InstanceID ) ); RequestFilterAndPresetsUpdateEvent.Broadcast(); } }
void FProfilerManager::ProfilerClient_OnLoadStarted( const FGuid& InstanceID ) { const FProfilerSessionRef* ProfilerSession = FindSessionInstance( InstanceID ); if( ProfilerSession && GetProfilerWindow().IsValid()) { const FString Description = (*ProfilerSession)->GetName(); // Display the notification that a file is being loaded. GetProfilerWindow()->ManageLoadingProgressNotificationState( (*ProfilerSession)->GetName(), EProfilerNotificationTypes::LoadingOfflineCapture, ELoadingProgressStates::Started, 0.0f ); } }
void FProfilerManager::ProfilerClient_OnLoadCompleted( const FGuid& InstanceID ) { // Inform that the file has been loaded and we can hide the notification. const FProfilerSessionRef* ProfilerSession = FindSessionInstance( InstanceID ); if( ProfilerSession && GetProfilerWindow().IsValid()) { (*ProfilerSession)->LoadComplete(); // Update the notification that a file has been loaded, to be precise it should be loaded on the next tick... GetProfilerWindow()->ManageLoadingProgressNotificationState( (*ProfilerSession)->GetName(), EProfilerNotificationTypes::LoadingOfflineCapture, ELoadingProgressStates::Loaded, 1.0f ); } }
void FProfilerManager::ProfilerSession_OnCaptureFileProcessed( const FGuid ProfilerInstanceID ) { const FProfilerSessionRef* ProfilerSession = FindSessionInstance( ProfilerInstanceID ); if( ProfilerSession && ProfilerWindow.IsValid()) { TrackDefaultStats(); RequestFilterAndPresetsUpdateEvent.Broadcast(); GetProfilerWindow()->UpdateEventGraph( ProfilerInstanceID, (*ProfilerSession)->GetEventGraphDataAverage(), (*ProfilerSession)->GetEventGraphDataMaximum(), true ); bHasCaptureFileFullyProcessed = true; } }
void FProfilerManager::ProfilerClient_OnProfilerData( const FGuid& InstanceID, const FProfilerDataFrame& Content, const float DataLoadingProgress ) { SCOPE_CYCLE_COUNTER(STAT_PM_HandleProfilerData); const FProfilerSessionRef* ProfilerSession = FindSessionInstance( InstanceID ); if( ProfilerSession && ProfilerWindow.IsValid()) { (*ProfilerSession)->UpdateProfilerData( Content ); // Game thread should always be enabled. TrackDefaultStats(); // Update the notification that a file is being loaded. GetProfilerWindow()->ManageLoadingProgressNotificationState( (*ProfilerSession)->GetName(), EProfilerNotificationTypes::LoadingOfflineCapture, ELoadingProgressStates::InProgress, DataLoadingProgress ); } }
const bool FProfilerManager::IsSessionInstanceTracked( const FGuid& SessionInstanceID ) const { const FProfilerSessionRef* ProfilerSessionPtr = FindSessionInstance( SessionInstanceID ); if( ProfilerSessionPtr ) { for( auto It = TrackedStats.CreateConstIterator(); It; ++It ) { const FTrackedStat& TrackedStat = It.Value(); const bool bIsSessionInstanceTracked = TrackedStat.CombinedGraphDataSource->IsProfilerSessionRegistered( SessionInstanceID ); if( bIsSessionInstanceTracked ) { return true; } } } return false; }
bool FProfilerManager::TrackStatForSessionInstance( const uint32 StatID, const FGuid& SessionInstanceID ) { bool bAdded = false; const FProfilerSessionRef* ProfilerSessionPtr = FindSessionInstance( SessionInstanceID ); const FTrackedStat* TrackedStat = TrackedStats.Find( StatID ); if( ProfilerSessionPtr && TrackedStat ) { const bool bIsStatReady = (*ProfilerSessionPtr)->GetMetaData()->IsStatInitialized( StatID ); const bool bIsExist = TrackedStat->CombinedGraphDataSource->IsProfilerSessionRegistered( SessionInstanceID ); if( bIsStatReady && !bIsExist ) { // Create graph data provider for tracked stat. FGraphDataSourceRefConst GraphDataSource = (*ProfilerSessionPtr)->CreateGraphDataSource( StatID ); TrackedStat->CombinedGraphDataSource->RegisterWithProfilerSession( SessionInstanceID, GraphDataSource ); bAdded = true; } } return bAdded; }