Class: Fluent::DeisGraphiteOutput
- Inherits:
-
Output
- Object
- Output
- Fluent::DeisGraphiteOutput
- Defined in:
- lib/fluent/plugin/out_deis-graphite.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
-
#initialize ⇒ DeisGraphiteOutput
constructor
A new instance of DeisGraphiteOutput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ DeisGraphiteOutput
Returns a new instance of DeisGraphiteOutput.
16 17 18 |
# File 'lib/fluent/plugin/out_deis-graphite.rb', line 16 def initialize super end |
Instance Method Details
#configure(conf) ⇒ Object
31 32 33 |
# File 'lib/fluent/plugin/out_deis-graphite.rb', line 31 def configure(conf) super end |
#emit(tag, es, chain) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fluent/plugin/out_deis-graphite.rb', line 35 def emit(tag, es, chain) es.each do |time,record| if record.key? "kubernetes" if record["kubernetes"]["container_name"] == "deis-router" = record["log"].split(" - ") app = [1].strip status_code = [4].strip #bytes_sent = split_message[6].strip.to_f #response_time = split_message[12].strip.to_f #request_time = split_message[13].strip.to_f Metriks.meter("response_rates.#{record["kubernetes"]["pod_name"]}.#{app}.#{status_code}").mark end end end chain.next end |
#shutdown ⇒ Object
27 28 29 |
# File 'lib/fluent/plugin/out_deis-graphite.rb', line 27 def shutdown super end |
#start ⇒ Object
20 21 22 23 24 25 |
# File 'lib/fluent/plugin/out_deis-graphite.rb', line 20 def start super puts "Starting reporter: #{@graphite_url}:#{@graphite_port}/#{@graphite_interval}" @reporter = Metriks::Reporter::Graphite.new @graphite_url, @graphite_port,:interval => @graphite_interval @reporter.start end |