예제 #1
0
        public async Task SendMetrics(object e)
        {
            var metricsBucket = _currentMetricsBucket;

            _currentMetricsBucket = new MetricsBucket();
            metricsBucket.End();
            ClientMetrics metrics = new ClientMetrics(_unleashConfig, metricsBucket);
            await _unleashMetricsSender.SendMetrics(metrics);
        }
예제 #2
0
        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);
        }
예제 #3
0
 internal ClientMetrics(UnleashConfig config, MetricsBucket bucket)
 {
     AppName    = config.AppName;
     InstanceId = config.InstanceId;
     Bucket     = bucket;
 }