public ProfilerControlWindow(ProfilerRunner runner) { InitializeComponent(); this.runner = runner; this.collectData.IsChecked = runner.Profiler.ProfilerOptions.EnableDCAtStart; }
ProfilerRunner CreateRunner(string path, string workingDirectory, string args, IProfilingDataWriter writer) { if (args == null) { throw new ArgumentNullException("args"); } if (workingDirectory == null) { throw new ArgumentNullException("workingdirectory"); } if (path == null) { throw new ArgumentNullException("path"); } if (!File.Exists(path)) { throw new FileNotFoundException("file '" + path + "' was not found!"); } if (!Directory.Exists(workingDirectory)) { throw new DirectoryNotFoundException("directory '" + workingDirectory + "' was not found!"); } ProcessStartInfo info = new ProcessStartInfo(path, args); info.WorkingDirectory = workingDirectory; ProfilerRunner runner = new ProfilerRunner(info, true, writer); return(runner); }
/// <summary> /// Starts the command /// </summary> public override void Run() { IProject currentProj = ProjectService.CurrentProject; string path = currentProj.GetSessionFileName(); Directory.CreateDirectory(Path.GetDirectoryName(path)); IProfilingDataWriter writer = new ProfilingDataSQLiteWriter(path); ProfilerRunner runner = ProfilerRunner.CreateRunner(writer); if (runner != null) { runner.RunFinished += delegate { currentProj.AddSessionToProject(path); }; runner.Run(); } }
protected override void RunTests(UnitTestApplicationStartHelper helper) { TestRunnerCategory.AppendLine(helper.GetCommandLine()); ProcessStartInfo startInfo = new ProcessStartInfo(helper.UnitTestApplication); string path = helper.Project.GetSessionFileName(); startInfo.Arguments = helper.GetArguments(); startInfo.WorkingDirectory = UnitTestApplicationStartHelper.UnitTestApplicationDirectory; LoggingService.Info("starting profiler..."); runner = new ProfilerRunner(startInfo, true, new ProfilingDataSQLiteWriter(path, true, GetUnitTestNames(helper).ToArray())); runner.RunFinished += delegate { WorkbenchSingleton.SafeThreadCall(() => FileService.OpenFile(path)); AfterFinish(helper, path); }; runner.Run(); }
ProfilerRunner CreateRunner(string path, string workingDirectory, string args, IProfilingDataWriter writer) { if (args == null) throw new ArgumentNullException("args"); if (workingDirectory == null) throw new ArgumentNullException("workingdirectory"); if (path == null) throw new ArgumentNullException("path"); if (!File.Exists(path)) throw new FileNotFoundException("file '" + path + "' was not found!"); if (!Directory.Exists(workingDirectory)) throw new DirectoryNotFoundException("directory '" + workingDirectory + "' was not found!"); ProcessStartInfo info = new ProcessStartInfo(path, args); info.WorkingDirectory = workingDirectory; ProfilerRunner runner = new ProfilerRunner(info, true, writer); return runner; }