protected SutAppBase() { Profiler = new ConsoleProfiler(25); PagesResolver = new PagesResolver <TApp>(this as TApp); Factory = new AppFactory <TStartUp>(); Client = new Lazy <TestHttpClient>(CreateClient); }
private static Session RunProfiler(Config config) { Trace.Verbose("DotTrace.RunConsole: Looking for runner..."); var runnerPath = ConsoleRunnerPackage.GetRunnerPath(); var commandLine = new StringBuilder(); commandLine.Append($"attach {Process.GetCurrentProcess().Id}"); commandLine.Append($" --profiling-type={config.Type}"); commandLine.Append(" --service-input=stdin --service-output=On"); commandLine.Append(" --collect-data-from-start=Off"); commandLine.Append(" --use-api"); if (config.LogFile != null) { commandLine.Append($" \"--log-file={config.LogFile}\" --debug-logging"); } if (config.IsOverwriteSnapshot) { commandLine.Append(" --overwrite"); } if (config.SnapshotDir != null) { commandLine.Append($" \"--save-to={config.SnapshotDir}\""); } if (config.SnapshotFile != null) { commandLine.Append($" \"--save-to={config.SnapshotFile}\""); } if (config.AskUacElevationIfRequired && config.Type == Config.ProfilingType.Timeline) { commandLine.Append(" --ask-uac-elevation"); } if (config.OtherArguments != null) { commandLine.Append(' ').Append(config.OtherArguments); } Trace.Info("DotTrace.RunConsole:\n runner = `{0}`\n arguments = `{1}`", runnerPath, commandLine); var collectedSnapshots = new CollectedSnapshots(); var consoleProfiler = new ConsoleProfiler( runnerPath, commandLine.ToString(), MessageServicePrefix, CltPresentableName, () => (MeasureProfiler.GetFeatures() & MeasureFeatures.Ready) == MeasureFeatures.Ready, collectedSnapshots); Trace.Verbose("DotTrace.RunConsole: Runner started."); return(new Session(consoleProfiler, collectedSnapshots)); }
private static Session RunConsole(string command, Config config) { Trace.Verbose("DotMemory.RunConsole: Looking for runner..."); var runnerPath = ConsoleRunnerPackage.GetRunnerPath(); var workspaceFile = GetSaveToFilePath(config); var commandLine = new StringBuilder(); if (config.LogLevel != null) { commandLine.Append($"--log-level={config.LogLevel} "); } if (config.LogFile != null) { commandLine.Append($"\"--log-file={config.LogFile}\" "); } commandLine.Append($"{command} {Process.GetCurrentProcess().Id} \"-f={workspaceFile}\""); if (config.IsOverwriteWorkspace) { commandLine.Append(" --overwrite"); } if (config.IsOpenDotMemory) { commandLine.Append(" --open-dotmemory"); } if (command != "get-snapshot") { commandLine.Append(" --use-api"); } if (config.OtherArguments != null) { commandLine.Append(' ').Append(config.OtherArguments); } Trace.Info("DotMemory.RunConsole:\n runner = `{0}`\n arguments = `{1}`", runnerPath, commandLine); var consoleProfiler = new ConsoleProfiler( runnerPath, commandLine.ToString(), MessageServicePrefix, CltPresentableName, () => (MemoryProfiler.GetFeatures() & MemoryFeatures.Ready) == MemoryFeatures.Ready ); Trace.Verbose("DotMemory.RunConsole: Runner started."); return(new Session(consoleProfiler, workspaceFile)); }
public Session(ConsoleProfiler consoleProfiler, string workspaceFile) { _consoleProfiler = consoleProfiler; WorkspaceFile = workspaceFile; }
public TestHttpClient(HttpClient client, ConsoleProfiler profiler) { this._client = client; _profiler = profiler; }
public Session(ConsoleProfiler consoleProfiler, CollectedSnapshots snapshots) { _consoleProfiler = consoleProfiler; _snapshots = snapshots; }