Beispiel #1
0
        public IActionResult GetMetricsFromAgent([FromRoute] DateTimeOffset fromTime, [FromRoute] DateTimeOffset toTime)
        {
            _logger.LogInformation($"Запрос метрики Memory");


            DateTimeOffset timeFrom = fromTime.UtcDateTime;
            DateTimeOffset timeto   = toTime.UtcDateTime;

            var metrics  = _repository.GetByDatePeriod(timeFrom, timeto);
            var response = new AllRamMetricsResponse()
            {
                Metrics = new List <RamMetricsDto>()
            };

            foreach (var metric in metrics)
            {
                response.Metrics.Add(_mapper.Map <RamMetricsDto>(metric));
            }
            return(Ok(response));
        }