Class: Triglav::Agent::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/triglav/agent/configuration.rb

Overview

Configure Triglav::Agent framework

require 'triglav/agent/configuration'
require 'triglav/agent/vertica/worker'
Triglav::Agent::Configuration.configure do |config|
  config.name = :vertica # default: :agent
  config.cli_class = Triglav::Agent::Vertica::CLI
  config.setting_class = Triglav::Agent::Vertica::Setting
  config.worker_module = Triglav::Agent::Vertica::Worker
  config.processor_class = Triglav::Agent::Vertica::Processor
  config.monitor_class = Triglav::Agent::Vertica::Monitor
  config.connection_class = Triglav::Agent::Vertica::Connection
end
Triglav::Agent::Configuration.cli_class.new.run

Class Method Summary collapse

Class Method Details

.cli_classObject



42
43
44
# File 'lib/triglav/agent/configuration.rb', line 42

def self.cli_class
  @cli_class ||= Triglav::Agent::Base::CLI
end

.cli_class=(cli_class) ⇒ Object



70
71
72
# File 'lib/triglav/agent/configuration.rb', line 70

def self.cli_class=(cli_class)
  @cli_class = cli_class
end

.configure {|Triglav::Agent::Configuration| ... } ⇒ Object



18
19
20
# File 'lib/triglav/agent/configuration.rb', line 18

def self.configure(&block)
  yield(Triglav::Agent::Configuration)
end

.connection_classObject



34
35
36
# File 'lib/triglav/agent/configuration.rb', line 34

def self.connection_class
  @connection_class ||= Triglav::Agent::Base::Connection
end

.connection_class=(connection_class) ⇒ Object



62
63
64
# File 'lib/triglav/agent/configuration.rb', line 62

def self.connection_class=(connection_class)
  @connection_class = connection_class
end

.monitor_classObject



30
31
32
# File 'lib/triglav/agent/configuration.rb', line 30

def self.monitor_class
  @monitor_class ||= Triglav::Agent::Base::Monitor
end

.monitor_class=(monitor_class) ⇒ Object



58
59
60
# File 'lib/triglav/agent/configuration.rb', line 58

def self.monitor_class=(monitor_class)
  @monitor_class = monitor_class
end

.nameObject



46
47
48
# File 'lib/triglav/agent/configuration.rb', line 46

def self.name
  @name ||= :agent
end

.name=(name) ⇒ Object



74
75
76
# File 'lib/triglav/agent/configuration.rb', line 74

def self.name=(name)
  @name = name
end

.processor_classObject



26
27
28
# File 'lib/triglav/agent/configuration.rb', line 26

def self.processor_class
  @processor_class ||= Triglav::Agent::Base::Processor
end

.processor_class=(processor_class) ⇒ Object



54
55
56
# File 'lib/triglav/agent/configuration.rb', line 54

def self.processor_class=(processor_class)
  @processor_class = processor_class
end

.setting_classObject



38
39
40
# File 'lib/triglav/agent/configuration.rb', line 38

def self.setting_class
  @setting_class ||= Triglav::Agent::Base::Setting
end

.setting_class=(setting_class) ⇒ Object



66
67
68
# File 'lib/triglav/agent/configuration.rb', line 66

def self.setting_class=(setting_class)
  @setting_class = setting_class
end

.worker_moduleObject



22
23
24
# File 'lib/triglav/agent/configuration.rb', line 22

def self.worker_module
  @worker_module ||= Triglav::Agent::Base::Worker
end

.worker_module=(worker_module) ⇒ Object



50
51
52
# File 'lib/triglav/agent/configuration.rb', line 50

def self.worker_module=(worker_module)
  @worker_module = worker_module
end