public async Task SendMetrics(object e) { var metricsBucket = _currentMetricsBucket; _currentMetricsBucket = new MetricsBucket(); metricsBucket.End(); ClientMetrics metrics = new ClientMetrics(_unleashConfig, metricsBucket); await _unleashMetricsSender.SendMetrics(metrics); }
internal UnleashMetricServiceImpl(UnleashConfig unleashConfig, UnleashMetricsSender unleashMetricsSender, IUnleashScheduledExecutor executor) { _currentMetricsBucket = new MetricsBucket(); _started = DateTime.UtcNow; _unleashConfig = unleashConfig; _metricsInterval = unleashConfig.SendMetricsInterval; _unleashMetricsSender = unleashMetricsSender; _unleashExecutor = executor; executor.SetInterval(async s => await SendMetrics(s), _metricsInterval, _metricsInterval); }
internal ClientMetrics(UnleashConfig config, MetricsBucket bucket) { AppName = config.AppName; InstanceId = config.InstanceId; Bucket = bucket; }