Class: Fluent::CloudwatchInput
- Inherits:
-
Input
- Object
- Input
- Fluent::CloudwatchInput
- Defined in:
- lib/fluent/plugin/in_cloudwatch.rb
Instance Attribute Summary collapse
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ CloudwatchInput
constructor
A new instance of CloudwatchInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ CloudwatchInput
Returns a new instance of CloudwatchInput.
38 39 40 |
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 38 def initialize super end |
Instance Attribute Details
#dimensions ⇒ Object
Returns the value of attribute dimensions.
36 37 38 |
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 36 def dimensions @dimensions end |
Instance Method Details
#configure(conf) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 42 def configure(conf) super @dimensions = [] if @dimensions_name && @dimensions_value names = @dimensions_name.split(",").each values = @dimensions_value.split(",").each loop do @dimensions.push({ :name => names.next, :value => values.next, }) end elsif @dimensions_name || @dimensions_value @dimensions.push({ :name => @dimensions_name, :value => @dimensions_value, }) end endpoint = URI(@cw_endpoint) if endpoint.scheme != "http" && endpoint.scheme != "https" @cw_endpoint_uri = "https://#{@cw_endpoint}" else @cw_endpoint_uri = endpoint.to_s end end |
#shutdown ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 80 def shutdown super @running = false @watcher.terminate @monitor.terminate @watcher.join @monitor.join end |
#start ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 70 def start super @running = true @updated = Time.now @watcher = Thread.new(&method(:watch)) @monitor = Thread.new(&method(:monitor)) @mutex = Mutex.new end |