Esempio n. 1
0
		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);
		}
Esempio n. 2
0
		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();
		}
Esempio n. 3
0
		private static int ProfilingModeToIndex(ProfilingMode profilingMode)
		{
			var profilingModeFlags = (int)profilingMode;
			int profilingModeInt = -1;
			while (profilingModeFlags > 0)
			{
				profilingModeFlags = profilingModeFlags >> 1;
				profilingModeInt++;
			}
			return profilingModeInt;
		}
Esempio n. 4
0
		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);
		}
Esempio n. 5
0
		public SystemProfilerSection GetProfilingResults(ProfilingMode profilingMode)
		{
			return Sections[ProfilingModeToIndex(profilingMode)];
		}
Esempio n. 6
0
 public static void AddProfilingMode(FlatBufferBuilder builder, ProfilingMode profilingMode)
 {
     builder.AddSbyte(2, (sbyte)profilingMode, 0);
 }
Esempio n. 7
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();
		}
Esempio n. 8
0
		public string GetProfilingResultsSummary(ProfilingMode profilingMode)
		{
			return new CodeProfilingResultsFormatter(GetProfilingResults(profilingMode)).Summary;
		}
Esempio n. 9
0
		public CodeProfilingResults GetProfilingResults(ProfilingMode profilingMode)
		{
			var index = ProfilingModeToIndex(profilingMode);
			return new CodeProfilingResults(new List<CodeProfilerSection>(Sections[index]));
		}
Esempio n. 10
0
			public SectionNeverStarted(ProfilingMode profilingMode, string name)
				: base("Profiling Mode '" + profilingMode + "', Section '" + name + "'") {}
Esempio n. 11
0
        public CodeProfilingResults GetProfilingResults(ProfilingMode profilingMode)
        {
            var index = ProfilingModeToIndex(profilingMode);

            return(new CodeProfilingResults(new List <CodeProfilerSection>(Sections[index])));
        }
Esempio n. 12
0
 public string GetProfilingResultsSummary(ProfilingMode profilingMode)
 {
     return(new CodeProfilingResultsFormatter(GetProfilingResults(profilingMode)).Summary);
 }
Esempio n. 13
0
 public SectionNeverStarted(ProfilingMode profilingMode, string name)
     : base("Profiling Mode '" + profilingMode + "', Section '" + name + "'")
 {
 }
Esempio n. 14
0
 public SystemProfilerSection GetProfilingResults(ProfilingMode profilingMode)
 {
     return(Sections[ProfilingModeToIndex(profilingMode)]);
 }