public InfluxMetricsSender(ILogger <InfluxMetricsSender> logger, ISatellitePassRepository passRepository, IOptions <InfluxMetricsConfiguration> options)
        {
            _logger         = logger;
            _passRepository = passRepository;
            var config = options.Value;

            if (string.IsNullOrEmpty(config.Url))
            {
                _logger.LogInformation("InfluxDB Url not set, skipping pass metrics");
            }
            else
            {
                _client = new LineProtocolClient(new Uri(config.Url), config.Database, config.Username, config.Password);
            }
        }
        public SatellitePassScraper(ILogger <SatellitePassScraper> logger, IOptions <SiteConfiguration> siteConfig, ISatellitePassRepository satellitePassRepository, NoaaWebDavFileProvider fileProvider)
        {
            _logger     = logger;
            _siteConfig = siteConfig.Value;
            _satellitePassRepository = satellitePassRepository;
            _fileProvider            = fileProvider;

            _scrapeCounter = Metrics.CreateCounter(
                "noaa_pass_scrape_total",
                "total number of times satellite passes were scraped",
                new CounterConfiguration
            {
                LabelNames = new string[] { "result" }
            });
            _scrapeDurationCounter = Metrics.CreateCounter(
                "noaa_pass_scrape_seconds_total",
                "total time satellite passes were scraped",
                new CounterConfiguration
            {
                LabelNames = new string[] { }
            });
            _passCounter = Metrics.CreateCounter(
                "noaa_pass_scrape_passes_total",
                "total number of scraped satellite passes",
                new CounterConfiguration
            {
                LabelNames = new string[] { "sat" }
            });
            _passDurationCounter = Metrics.CreateCounter(
                "noaa_pass_scrape_passes_seconds_total",
                "total duration of scraped satellite passes",
                new CounterConfiguration
            {
                LabelNames = new string[] { "sat" }
            });
        }
 public ProjectionViewController(ILogger <ProjectionViewController> logger, ISatellitePassRepository passRepository)
 {
     _logger         = logger;
     _passRepository = passRepository;
 }
Example #4
0
 public SatellitePassController(ILogger <SatellitePassController> logger, ISatellitePassRepository passRepository, IUpcomingPassRepository upcomingPassRepository)
 {
     _logger                 = logger;
     _passRepository         = passRepository;
     _upcomingPassRepository = upcomingPassRepository;
 }