Beispiel #1
0
        public override void Dispose()
        {
            if (TimelineProfiler.IsActive)
            {
                TimelineProfiler.EndSave();
            }

            if (TimelineProfiler.CanDetach)
            {
                TimelineProfiler.Detach();
            }

            base.Dispose();
        }
Beispiel #2
0
        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();
            }
        }