Ejemplo n.º 1
0
        public async Task AddMetric(MetricModel metric)
        {
            try
            {
                _logger.LogTrace("Saving the Job", metric);
                Metric metricdto = _translator.Translate <Metric>(metric);

                await _tsdbClient.AddMetricsAsync(metricdto);

                MetricAddedIntegrationEvent test = new MetricAddedIntegrationEvent(
                    metric.Name, metric.Tags, metric.DataPoints, metric.Type);
                _eventBus.Publish(test);


                _logger.LogTrace("Item Saved & event publised. event:", test);
            }
            catch (Exception ex)
            {
                _logger.LogError("Unable to save the  metric", ex);
            }
            await Task.CompletedTask;
        }