Пример #1
0
        public async Task <WorkerStatus> GetWorkerStatusAsync()
        {
            var sw = ValueStopwatch.StartNew();
            await _httpWorkerService.PingAsync();

            var elapsed      = sw.GetElapsedTime();
            var workerStatus = new WorkerStatus
            {
                Latency = elapsed
            };

            _workerChannelLogger.LogDebug($"[HostMonitor] Worker status request took {elapsed.TotalMilliseconds}ms");
            return(workerStatus);
        }
Пример #2
0
        public async Task <WorkerStatus> GetWorkerStatusAsync()
        {
            var sw = Stopwatch.StartNew();
            await _httpWorkerService.PingAsync();

            sw.Stop();
            var workerStatus = new WorkerStatus
            {
                ProcessStats = _workerProcess.GetStats()
            };

            workerStatus.Latency = sw.Elapsed;
            _workerChannelLogger.LogDebug($"[HostMonitor] Worker status request took {sw.ElapsedMilliseconds}ms");
            return(workerStatus);
        }