Beispiel #1
0
 protected ConfigCommandBase(string name, string description, IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness, IMetaDataBusiness metaDataBusiness)
     : base(name, description)
 {
     _influxDbAgentLoader = influxDbAgentLoader;
     _configBusiness      = configBusiness;
     _metaDataBusiness    = metaDataBusiness;
 }
Beispiel #2
0
 public InfluxDataSender(IInfluxDbAgentLoader influxDbAgentLoader, IDatabaseConfig databaseConfig, int maxQueueSize)
 {
     _databaseConfig    = databaseConfig;
     _maxQueueSize      = maxQueueSize;
     _maxSendBatchCount = 1000;
     _dropOnFail        = false;
     _client            = new Lazy <IInfluxDbAgent>(() => influxDbAgentLoader.GetAgent(databaseConfig));
 }
 public InfluxDataSender(IInfluxDbAgentLoader influxDbAgentLoader, IDatabaseConfig databaseConfig, int maxQueueSize)
 {
     _databaseConfig = databaseConfig;
     _maxQueueSize = maxQueueSize;
     _maxSendBatchCount = 1000;
     _dropOnFail = false;
     _client = new Lazy<IInfluxDbAgent>(() => influxDbAgentLoader.GetAgent(databaseConfig));
 }
        public SendBusiness(IConfigBusiness configBusiness, IInfluxDbAgentLoader influxDbAgentLoader)
        {
            var config = configBusiness.LoadFiles();

            _timer = new Timer(1000 * config.Application.FlushSecondsInterval);
            _timer.Elapsed += Elapsed;

            _client = new Lazy<IInfluxDbAgent>(() => influxDbAgentLoader.GetAgent(config.Database));
        }
        public SendBusiness(IConfigBusiness configBusiness, IInfluxDbAgentLoader influxDbAgentLoader)
        {
            var config = configBusiness.LoadFiles();

            var flushMilliSecondsInterval = 1000 * config.Application.FlushSecondsInterval;
            if (flushMilliSecondsInterval > 0)
            {
                _timer = new Timer(flushMilliSecondsInterval);
                _timer.Elapsed += Elapsed;
            }

            _dataSenders = config.Databases.Where(x => x.IsEnabled).Select(x => x.GetDataSender(influxDbAgentLoader, config.Application.MaxQueueSize)).ToList();
            foreach (var dataSender in _dataSenders)
            {
                dataSender.SendCompleteEvent += OnSendBusinessEvent;
            }

            _metadata = config.Application.Metadata;
        }
        public SendBusiness(IConfigBusiness configBusiness, IInfluxDbAgentLoader influxDbAgentLoader)
        {
            var config = configBusiness.LoadFiles();

            var flushMilliSecondsInterval = 1000 * config.Application.FlushSecondsInterval;

            if (flushMilliSecondsInterval > 0)
            {
                _timer          = new Timer(flushMilliSecondsInterval);
                _timer.Elapsed += Elapsed;
            }

            _dataSenders = config.Databases.Where(x => x.IsEnabled).Select(x => x.GetDataSender(influxDbAgentLoader, config.Application.MaxQueueSize)).ToList();
            foreach (var dataSender in _dataSenders)
            {
                dataSender.SendCompleteEvent += OnSendBusinessEvent;
            }

            _metadata = config.Application.Metadata;
        }
 public IDataSender GetDataSender(IInfluxDbAgentLoader influxDbAgentLoader, int maxQueueSize)
 {
     return(new InfluxDataSender(new InfluxDataSenderConfiguration(IsEnabled, maxQueueSize, Url, Name, Username, Password)));
 }
 public IDataSender GetDataSender(IInfluxDbAgentLoader influxDbAgentLoader, int maxQueueSize)
 {
     return new AccDataSender(maxQueueSize);
 }
 public ConfigDatabaseCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Database", "Change the database settings without changing server.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness = configBusiness;
 }
 protected ConfigCommandBase(string name, string description, IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base(name, description)
 {
     _influxDbAgentLoader = influxDbAgentLoader;
     _configBusiness = configBusiness;
 }
Beispiel #11
0
 public ConfigServerCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Server", "Change the database and server settings.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness = configBusiness;
 }
 public ConfigAutoCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness, ICounterBusiness counterBusiness)
     : base("Auto", "Automatically run full setup.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness = configBusiness;
     _counterBusiness = counterBusiness;
 }
 public ConfigServerCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Change", "Change connection for server and database.", influxDbAgentLoader, configBusiness)
 {
 }
 public ConfigureApplicationCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness, IMetaDataBusiness metaDataBusiness)
     : base("Application", "Change the application configuration.", influxDbAgentLoader, configBusiness, metaDataBusiness)
 {
     _configBusiness = configBusiness;
 }
 public IDataSender GetDataSender(IInfluxDbAgentLoader influxDbAgentLoader, int maxQueueSize)
 {
     return new InfluxDataSender(new InfluxDataSenderConfiguration(IsEnabled, maxQueueSize, Url, Name, Username, Password));
 }
 public ConfigShowCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Show", "Show setup.")
 {
     _influxDbAgentLoader = influxDbAgentLoader;
     _configBusiness      = configBusiness;
 }
 public ConfigDatabaseCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Database", "Change the database settings without changing server.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness = configBusiness;
 }
 public ConfigShowCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Show", "Show setup.")
 {
     _influxDbAgentLoader = influxDbAgentLoader;
     _configBusiness = configBusiness;
 }
 public IDataSender GetDataSender(IInfluxDbAgentLoader influxDbAgentLoader, int maxQueueSize)
 {
     return(new KafkaDataSender(this, maxQueueSize));
 }
 public ConsoleSendBusiness(IConfigBusiness configBusiness, IInfluxDbAgentLoader influxDbAgentLoader, Action<string, OutputLevel> outputMessage)
 {
     _configBusiness = configBusiness;
     _influxDbAgentLoader = influxDbAgentLoader;
     _outputMessage = outputMessage;
 }
 public IDataSender GetDataSender(IInfluxDbAgentLoader influxDbAgentLoader, int maxQueueSize)
 {
     return new KafkaDataSender(this, maxQueueSize);
 }
 public ConfigureApplicationCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Application", "Change the application configuration.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness = configBusiness;
 }
 public IDataSender GetDataSender(IInfluxDbAgentLoader influxDbAgentLoader, int maxQueueSize)
 {
     return(new AccDataSender(maxQueueSize));
 }
 public ConfigServerCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness)
     : base("Server", "Change the database and server settings.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness = configBusiness;
 }
Beispiel #25
0
 public ConsoleSendBusiness(IConfigBusiness configBusiness, IInfluxDbAgentLoader influxDbAgentLoader, Action <string, OutputLevel> outputMessage)
 {
     _configBusiness      = configBusiness;
     _influxDbAgentLoader = influxDbAgentLoader;
     _outputMessage       = outputMessage;
 }
 public ConfigAutoCommand(IInfluxDbAgentLoader influxDbAgentLoader, IConfigBusiness configBusiness, ICounterBusiness counterBusiness)
     : base("Auto", "Automatically run full setup.", influxDbAgentLoader, configBusiness)
 {
     _configBusiness  = configBusiness;
     _counterBusiness = counterBusiness;
 }