예제 #1
0
        public IActionResult GetMetricsFromAgent(
            [FromRoute] int idAgent,
            [FromRoute] DateTimeOffset fromTime,
            [FromRoute] DateTimeOffset toTime)
        {
            var metrics  = _repository.GetMetricsFromTimeToTimeFromAgent(fromTime, toTime, idAgent);
            var response = new AllRamMetricsResponse()
            {
                Metrics = new List <RamMetricManagerDto>()
            };

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

            _logger.LogInformation($"Запрос метрик Ram FromTime = {fromTime} ToTime = {toTime} для агента Id = {idAgent}");

            return(Ok(response));
        }