Module: Fluentd::Agent::Common
- Included in:
- FluentdGem, Remote, TdAgent
- Defined in:
- app/models/fluentd/agent/common.rb
Instance Attribute Summary collapse
-
#extra_options ⇒ Object
readonly
Returns the value of attribute extra_options.
Instance Method Summary collapse
- #config_file ⇒ Object
- #errors_since(since = 1.day.ago) ⇒ Object
- #initialize(options = {}) ⇒ Object
- #log_file ⇒ Object
- #pid_file ⇒ Object
- #recent_errors(limit = 3) ⇒ Object
- #wait_process_starting_seconds ⇒ Object
Instance Attribute Details
#extra_options ⇒ Object (readonly)
Returns the value of attribute extra_options.
20 21 22 |
# File 'app/models/fluentd/agent/common.rb', line 20 def @extra_options end |
Instance Method Details
#config_file ⇒ Object
56 57 58 |
# File 'app/models/fluentd/agent/common.rb', line 56 def config_file [:config_file] || self.class.[:config_file] end |
#errors_since(since = 1.day.ago) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/models/fluentd/agent/common.rb', line 30 def errors_since(since = 1.day.ago) errors = [] logged_errors do |error| break if Time.parse(error[:subject]) < since errors << error end errors end |
#initialize(options = {}) ⇒ Object
22 23 24 |
# File 'app/models/fluentd/agent/common.rb', line 22 def initialize( = {}) @extra_options = end |
#log_file ⇒ Object
52 53 54 |
# File 'app/models/fluentd/agent/common.rb', line 52 def log_file [:log_file] || self.class.[:log_file] end |
#pid_file ⇒ Object
48 49 50 |
# File 'app/models/fluentd/agent/common.rb', line 48 def pid_file [:pid_file] || self.class.[:pid_file] end |
#recent_errors(limit = 3) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'app/models/fluentd/agent/common.rb', line 39 def recent_errors(limit = 3) errors = [] logged_errors do |error| errors << error break if errors.length >= limit end errors end |
#wait_process_starting_seconds ⇒ Object
26 27 28 |
# File 'app/models/fluentd/agent/common.rb', line 26 def wait_process_starting_seconds 10.seconds # wait time for fluentd pidfile created end |