private static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-us"); var processStartInfo = new ProcessStartInfo { FileName = @"..\..\..\Mandelbrot\Bin\Mandelbrot.exe" }; if (false) { var profilerAccess = new TracingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback); profilerAccess.StartProfiler(); profilerAccess.Wait(); //ManualResetEvent Console.WriteLine("bye bye"); } else { var profilerAccess = new SamplingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback2); profilerAccess.StartProfiler(); profilerAccess.Wait(); Console.WriteLine("bye bye"); } }
private static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-us"); var processStartInfo = new ProcessStartInfo{ FileName = @"..\..\..\Mandelbrot\Bin\Mandelbrot.exe" }; if (false) { var profilerAccess = new TracingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback); profilerAccess.StartProfiler(); profilerAccess.Wait(); //ManualResetEvent Console.WriteLine("bye bye"); } else { var profilerAccess = new SamplingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback2); profilerAccess.StartProfiler(); profilerAccess.Wait(); Console.WriteLine("bye bye"); } }
public void Profile(ProfilerTypes profiler, string processPath) { ProcessStartInfo processStartInfo = new ProcessStartInfo { FileName = processPath }; CriterionSwitchViewModel[] criterionSwitchVMs; if (profiler == ProfilerTypes.TracingProfiler) { var profilerAccess = new TracingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback); _closeProfileeProcessAction = profilerAccess.CloseProfileeProcess; profilerAccess.StartProfiler(); _uiLogic.ActiveCriterion = TracingCriteriaContext.CallCountCriterion; criterionSwitchVMs = new[] { new CriterionSwitchViewModel(TracingCriteriaContext.CallCountCriterion) { IsActive = true }, new CriterionSwitchViewModel(TracingCriteriaContext.TimeActiveCriterion), new CriterionSwitchViewModel(TracingCriteriaContext.TimeWallClockCriterion) }; } else { var profilerAccess = new SamplingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback); _closeProfileeProcessAction = profilerAccess.CloseProfileeProcess; profilerAccess.StartProfiler(); _uiLogic.ActiveCriterion = SamplingCriteriaContext.TopStackOccurrenceCriterion; criterionSwitchVMs = new[] { new CriterionSwitchViewModel(SamplingCriteriaContext.TopStackOccurrenceCriterion) { IsActive = true }, new CriterionSwitchViewModel(SamplingCriteriaContext.DurationCriterion) }; } foreach (var switchVM in criterionSwitchVMs) { switchVM.CriterionChanged += _uiLogic.ActivateCriterion; } criteriaSwitch.DataContext = criterionSwitchVMs; _uiLogic.CriterionSwitchVMs = criterionSwitchVMs; }
public void Profile(ProfilerTypes profiler, string processPath) { ProcessStartInfo processStartInfo = new ProcessStartInfo { FileName = processPath }; CriterionSwitchViewModel[] criterionSwitchVMs; if (profiler == ProfilerTypes.TracingProfiler) { var profilerAccess = new TracingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback); _closeProfileeProcessAction = profilerAccess.CloseProfileeProcess; profilerAccess.StartProfiler(); _uiLogic.ActiveCriterion = TracingCriteriaContext.CallCountCriterion; criterionSwitchVMs = new[] { new CriterionSwitchViewModel(TracingCriteriaContext.CallCountCriterion){IsActive = true}, new CriterionSwitchViewModel(TracingCriteriaContext.TimeActiveCriterion), new CriterionSwitchViewModel(TracingCriteriaContext.TimeWallClockCriterion)}; } else { var profilerAccess = new SamplingProfilerAccess( processStartInfo, TimeSpan.FromMilliseconds(1000), OnUpdateCallback); _closeProfileeProcessAction = profilerAccess.CloseProfileeProcess; profilerAccess.StartProfiler(); _uiLogic.ActiveCriterion = SamplingCriteriaContext.TopStackOccurrenceCriterion; criterionSwitchVMs = new[] { new CriterionSwitchViewModel(SamplingCriteriaContext.TopStackOccurrenceCriterion){IsActive = true}, new CriterionSwitchViewModel(SamplingCriteriaContext.DurationCriterion)}; } foreach (var switchVM in criterionSwitchVMs) { switchVM.CriterionChanged += _uiLogic.ActivateCriterion; } criteriaSwitch.DataContext = criterionSwitchVMs; _uiLogic.CriterionSwitchVMs = criterionSwitchVMs; }