public CodeProfilingResultsFormatter(CodeProfilingResults results) { if (results.Sections.Count == 0) Summary = "(Nothing profiled)"; else FormSummary(results); }
public void EmptyProfilingSummary() { var profilingResults = new CodeProfilingResults(new List <CodeProfilerSection>()); var profilingResultsFormatter = new CodeProfilingResultsFormatter(profilingResults); var profiler = new CodeProfiler(); Assert.AreEqual(profilingResultsFormatter.Summary, profiler.GetProfilingResultsSummary(ProfilingMode.Rendering)); }
public CodeProfilingResultsFormatter(CodeProfilingResults results) { if (results.Sections.Count == 0) { Summary = "(Nothing profiled)"; } else { FormSummary(results); } }
private void FormSummary(CodeProfilingResults results) { results.Sections.Sort(); string sections = results.Sections.Count == 1 ? " section" : " sections"; Summary = "We got " + results.Sections.Count + sections + " that took in total: " + results.TotalSectionTime + "s (which seems to be about " + (100.0f * results.TotalSectionTime / results.TotalTime) + "% of the total application time: " + results.TotalTime + "s)"; if (results.TotalSectionTime > 0) foreach (CodeProfilerSection section in results.Sections) Summary += "\n Section " + section.Name + " took: " + section.TotalTime + "s (" + (100.0f * section.TotalTime / results.TotalSectionTime) + "%), Calls: " + section.Calls + ", first time called: " + section.TimeCreated + "s"; }
private void FormSummary(CodeProfilingResults results) { results.Sections.Sort(); string sections = results.Sections.Count == 1 ? " section" : " sections"; Summary = "We got " + results.Sections.Count + sections + " that took in total: " + results.TotalSectionTime + "s (which seems to be about " + (100.0f * results.TotalSectionTime / results.TotalTime) + "% of the total application time: " + results.TotalTime + "s)"; if (results.TotalSectionTime > 0) { foreach (CodeProfilerSection section in results.Sections) { Summary += "\n Section " + section.Name + " took: " + section.TotalTime + "s (" + (100.0f * section.TotalTime / results.TotalSectionTime) + "%), Calls: " + section.Calls + ", first time called: " + section.TimeCreated + "s"; } } }
public void EmptyProfilingSummary() { var profilingResults = new CodeProfilingResults(new List<CodeProfilerSection>()); var profilingResultsFormatter = new CodeProfilingResultsFormatter(profilingResults); var profiler = new CodeProfiler(); Assert.AreEqual(profilingResultsFormatter.Summary, profiler.GetProfilingResultsSummary(ProfilingMode.Rendering)); }