Esempio n. 1
0
        private void logPerformance(object state)
        {
            //Console.WriteLine($"[{DateTimeOffset.Now}]{PerformanceMetric.Create()}");
            var metricCollector = new PerformanceMetric()
            {
                Processer = _processorMeteric.GetUsage(),
                Memory    = _memoryMeteric.GetMemoryUsage(),
                Network   = _networkThroughtputMeteric.GetThroughtput()
            };

            _deliverMeteric.DeliverMetric(metricCollector);
        }
 public int GetUsage()
 {
     return(PerformanceMetric.Create().Processer);
 }
 public long GetThroughtput()
 {
     return(PerformanceMetric.Create().Network);
 }
 public long GetMemoryUsage()
 {
     return(PerformanceMetric.Create().Memory);
 }
Esempio n. 5
0
 public Task DeliverMetric(PerformanceMetric metricCounter)
 {
     Console.WriteLine($"[{DateTimeOffset.UtcNow}] Deliver performance content " +
                       $"{metricCounter} to {_endpoint} via {_transportType}");
     return(Task.CompletedTask);
 }