Example #1
0
        public IActionResult GetMetricsFromCluster(
            [FromRoute] DateTimeOffset fromTime,
            [FromRoute] DateTimeOffset toTime)
        {
            var metrics  = _repository.GetMetricsFromTimeToTime(fromTime, toTime);
            var response = new AllHddMetricsResponse()
            {
                Metrics = new List <HddMetricManagerDto>()
            };

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

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

            return(Ok(response));
        }