public PerformanceProfile(string sdkPath, string resultsDirectory) : base(resultsDirectory) { var saveSnapshotProfilingConfig = new SaveSnapshotProfilingConfig { ProfilingControlKind = ProfilingControlKind.Api, TempDir = Path.GetTempPath(), SaveDir = resultsDirectory, RedistDir = sdkPath, ProfilingType = ProfilingType.Performance, ListFile = this.ListFile, SnapshotFormat = SnapshotFormat.Uncompressed }; while (SelfAttach.State != SelfApiState.None) { Thread.Sleep(250); } SelfAttach.Attach(saveSnapshotProfilingConfig); this.WaitForProfilerToAttachToProcess(); if (PerformanceProfiler.IsActive) { PerformanceProfiler.Begin(); PerformanceProfiler.Start(); } }
public MemoryProfile(string sdkPath, string resultsDirectory) : base(resultsDirectory) { var saveSnapshotProfilingConfig = new SaveSnapshotProfilingConfig { ProfilingControlKind = ProfilingControlKind.Api, TempDir = Path.GetTempPath(), SaveDir = resultsDirectory, RedistDir = sdkPath, ProfilingType = ProfilingType.Memory, ListFile = this.ListFile }; while (SelfAttach.State != SelfApiState.None) { Thread.Sleep(250); } SelfAttach.Attach(saveSnapshotProfilingConfig); this.WaitForProfilerToAttachToProcess(); if (MemoryProfiler.IsActive && MemoryProfiler.CanControlAllocations) { MemoryProfiler.EnableAllocations(); } }
// ReSharper disable once UnusedParameter.Local private void ExecuteHandler(ClientSession session) { SelfAttach.Attach(new SaveSnapshotProfilingConfig { ProfilingControlKind = ProfilingControlKind.Api, SaveDir = "C:\\ProfilerLogs", RedistDir = "C:\\ProfilerSDK", ProfilingType = ProfilingType.Performance, ListFile = "C:\\ProfilerLogs\\snapshot_list.xml" // the file is created automatically during profiling }); }
public TimelineProfile(string sdkPath, string resultsDirectory) : base(resultsDirectory) { var saveSnapshotProfilingConfig = new SaveSnapshotProfilingConfig { ProfilingControlKind = ProfilingControlKind.Api, TempDir = Path.GetTempPath(), SaveDir = resultsDirectory, RedistDir = sdkPath, ProfilingType = ProfilingType.Timeline, ListFile = ListFile, SnapshotFormat = SnapshotFormat.Uncompressed }; SelfAttach.Attach(saveSnapshotProfilingConfig); WaitForProfilerToAttachToProcess(); if (TimelineProfiler.IsActive) { TimelineProfiler.Begin(); } }