Esempio n. 1
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            if (_server == null)
            {
                return;
            }

            _logger.LogInformation($"Publishing Prometheus metrics on port {_port}.");

            _server.Start();

            try
            {
                await Task.Delay(-1, stoppingToken);
            }
            finally
            {
                await _server.StopAsync();
            }
        }
 public Task StopAsync(CancellationToken ct)
 {
     return(_metricsServer.StopAsync());
 }