private void LogProfilingModeValues(ProfilingMode profilingMode, SystemInformation systemInformation) { if (profilingMode.HasFlag(ProfilingMode.Fps)) GetProfilingResults(ProfilingMode.Fps).Log(GlobalTime.Current.Fps); if (profilingMode.HasFlag(ProfilingMode.AvailableRam)) GetProfilingResults(ProfilingMode.AvailableRam).Log(systemInformation.AvailableRam); }
public void Log(ProfilingMode profilingMode, SystemInformation systemInformation) { float time = GlobalTime.Current.GetSecondsSinceStartToday(); if (!IsActive || time - lastTimeProfiled < pollingInterval) return; lastTimeProfiled = time; LogProfilingModeValues(profilingMode, systemInformation); if (Updated != null) Updated(); }
private static int ProfilingModeToIndex(ProfilingMode profilingMode) { var profilingModeFlags = (int)profilingMode; int profilingModeInt = -1; while (profilingModeFlags > 0) { profilingModeFlags = profilingModeFlags >> 1; profilingModeInt++; } return profilingModeInt; }
public void Start(ProfilingMode profilingMode, string sectionName) { if (!IsActive) return; var index = ProfilingModeToIndex(profilingMode); int sectionIndex; if (SectionMaps[index].TryGetValue(sectionName, out sectionIndex)) Sections[index][sectionIndex].Start(pollingInterval); else AddAndStartNewSection(index, sectionName); }
public SystemProfilerSection GetProfilingResults(ProfilingMode profilingMode) { return Sections[ProfilingModeToIndex(profilingMode)]; }
public static void AddProfilingMode(FlatBufferBuilder builder, ProfilingMode profilingMode) { builder.AddSbyte(2, (sbyte)profilingMode, 0); }
public void Stop(ProfilingMode profilingMode, string sectionName) { if (!IsActive) return; var index = ProfilingModeToIndex(profilingMode); int sectionIndex; if (!SectionMaps[index].TryGetValue(sectionName, out sectionIndex)) throw new SectionNeverStarted(profilingMode, sectionName); didProfilingOccur |= Sections[index][sectionIndex].StopIfProfiling(); }
public string GetProfilingResultsSummary(ProfilingMode profilingMode) { return new CodeProfilingResultsFormatter(GetProfilingResults(profilingMode)).Summary; }
public CodeProfilingResults GetProfilingResults(ProfilingMode profilingMode) { var index = ProfilingModeToIndex(profilingMode); return new CodeProfilingResults(new List<CodeProfilerSection>(Sections[index])); }
public SectionNeverStarted(ProfilingMode profilingMode, string name) : base("Profiling Mode '" + profilingMode + "', Section '" + name + "'") {}
public CodeProfilingResults GetProfilingResults(ProfilingMode profilingMode) { var index = ProfilingModeToIndex(profilingMode); return(new CodeProfilingResults(new List <CodeProfilerSection>(Sections[index]))); }
public string GetProfilingResultsSummary(ProfilingMode profilingMode) { return(new CodeProfilingResultsFormatter(GetProfilingResults(profilingMode)).Summary); }
public SectionNeverStarted(ProfilingMode profilingMode, string name) : base("Profiling Mode '" + profilingMode + "', Section '" + name + "'") { }
public SystemProfilerSection GetProfilingResults(ProfilingMode profilingMode) { return(Sections[ProfilingModeToIndex(profilingMode)]); }