static RamjetProfiler() { _root = new ProfilerEntry("Game"); _stack = new Stack <ProfilerEntry> (); ResetStack(); }
// TODO : CONVERT THE PROFILER TO MEDIA TIMERS public static void Enter(ProfilerEntry entry) { #if DEBUG Entries[(int)entry]++; _lastTicks = System.DateTime.Now.Ticks; #endif }
// TODO : CONVERT THE PROFILER TO MEDIA TIMERS public static void Enter(ProfilerEntry entry) { #if DEBUG Entries[(int)entry]++; _lastTicks = System.DateTime.Now.Ticks; #endif }
public bool contextChangesWhen(ProfilerEntry entry) { if (entry.IsSetup) { return(true); } return(entry.Type == ProfileType.Enter && entry.IsFixtureConstructor); }
public void Add(string section, float duration) { if (!_profiles.ContainsKey(section)) { _profiles[section] = new ProfilerEntry(_averageWindowSize); } _profiles[section].Age = 0; _profiles[section].Average.Update(duration); _totalTime = _profiles.Values.Select(entry => entry.Average.GetAverage()).Sum(); }
public MeasureResult(MyCubeGrid myCubeGrid, ProfilerEntry profilerEntry, ulong ticks) { EntityId = myCubeGrid.EntityId; EntityDisplayName = myCubeGrid.DisplayName; EntityCoords = myCubeGrid.PositionComp.WorldAABB.Center; MainThreadTimePerTick = profilerEntry.MainThreadTime / ticks; PlayerIdentityId = myCubeGrid.BigOwners.FirstOrDefault(it => it != 0); PlayerSteamId = MySession.Static.Players.TryGetSteamId(PlayerIdentityId); PlayerDisplayName = MySession.Static.Players.TryGetIdentity(PlayerIdentityId)?.DisplayName ?? "Nobody"; var faction = MySession.Static.Factions.GetPlayerFaction(PlayerIdentityId); FactionId = faction?.FactionId; FactionName = faction?.Name; }
private static void LogFrameResultsRecursively(ProfilerEntry e, int depth, StringBuilder b) { if (e.HasResult()) { // Indentation for callstack depth for (int i = 0; i < depth; i++) { b.Append("-"); } b.AppendFormat(" {0}: {1:0.00}ms, {2} calls\n", e.Id, e.AverageSeconds * 1000d, e.TimesCalled); } if (e.HasChildren()) { for (int i = 0; i < e.Children.Count; i++) { LogFrameResultsRecursively(e.Children[i], depth + 1, b); } } }
public void Enrich(ProfilerEntry entry) { var node = TryGetEfferentCouplingNode(entry.Runtime.Replace('+', '/')); entry.Found = node != null; if (node != null) { var tmpname = _testIdentifiers.GetSpecificallyMangledName(node.MemberReference as MethodReference); if (tmpname != null) { entry.Method = tmpname; entry.Runtime = tmpname; } entry.IsTest = _testIdentifiers.IsProfilerTest(node.MemberReference as MethodReference); entry.IsSetup = _testIdentifiers.IsProfilerSetup(node.MemberReference as MethodReference); entry.IsTeardown = _testIdentifiers.IsProfilerTeardown(node.MemberReference as MethodReference); entry.IsFixtureConstructor = IsFixtureConstructor(node); entry.Reference = node.MemberReference; } }
private void DoStart(string token) { ProfilerEntry entry; if (!_watches.TryGetValue(token, out entry)) { entry = new ProfilerEntry(); _watches[token] = entry; } entry.StartWatch(token); }
public static void Leave(ProfilerEntry entry) { #if DEBUG Times[(int)entry] += System.DateTime.Now.Ticks - _lastTicks; #endif }
public uint ReadPerformanceTicks(uint thread, ProfilerEntry entry) { return NativeAPI.ReadPerformanceTicks(handle, thread, (uint)entry); }
public static void Leave(ProfilerEntry entry) { #if DEBUG Times[(int)entry] += System.DateTime.Now.Ticks - _lastTicks; #endif }