public TelemetryLogService(ILogger <TelemetryLogService> logger, ICacheStore store, AwsConfiguration awsConfiguration = null, MetricsConfiguration metricsConfiguration = null) { _logger = logger; _metricsConfiguration = metricsConfiguration; _redisStore = store as RedisCacheStore; if (awsConfiguration != null && metricsConfiguration != null) { _amazonCloudWatchClient = new AmazonCloudWatchClient(awsConfiguration.AccessKeyId, awsConfiguration.SecretAccessKey, RegionEndpoint.GetBySystemName(awsConfiguration.Region)); } }
public AwsEventsMetricsService(AwsConfiguration awsConfiguration, MetricsConfiguration metricsConfiguration, ILogger <AwsEventsMetricsService> logger) { _metricsConfiguration = metricsConfiguration; _updateInterval = TimeSpan.FromMilliseconds(metricsConfiguration.Interval); _logger = logger; _timer = new Timer(TimerInterval) { AutoReset = true, Enabled = true }; _timer.Elapsed += ProcessQueue; _amazonCloudWatchClient = new AmazonCloudWatchClient(awsConfiguration.AccessKeyId, awsConfiguration.SecretAccessKey, RegionEndpoint.GetBySystemName(awsConfiguration.Region)); }