internal static bool Prefix(Navigator ___navigator, int ___cell)
            {
                // If nothing has changed since last time, it is a hit!
                var  cached = PathCacher.Lookup(___navigator.PathProber);
                bool hit    = cached.CheckAndUpdate(___navigator, ___cell);

                if (debug)
                {
                    DebugMetrics.LogHit(hit);
                }
                return(!hit);
            }
示例#2
0
 /// <summary>
 /// Avoids stacking up queues by waiting for the async path probe. Game updates almost
 /// all Sim and Render handlers (including BrainScheduler) in a LateUpdate call
 /// (not Update, KLEI PLEASE), so we let it spill over into the next frame and just
 /// hold up the next LateUpdate with a regular Update.
 /// </summary>
 public void Update()
 {
     if (jobManager != null)
     {
         if (debug)
         {
             var now = Stopwatch.StartNew();
             jobManager.Wait();
             DebugMetrics.LogPathProbe(now.ElapsedTicks, jobManager.LastRunTime);
         }
         else
         {
             jobManager.Wait();
         }
     }
 }
        public override async Task <JObject> ExecuteAsync(IClient client)
        {
            var debugMetrics = new DebugMetrics(client);

            return(await debugMetrics.SendRequestAsync());
        }
示例#4
0
 public DebugApiService(IClient client) : base(client)
 {
     DebugStorageRangeAt   = new DebugStorageRangeAt(client);
     DebugTraceTransaction = new DebugTraceTransaction(client);
     DebugMetrics          = new DebugMetrics(client);
 }