Class: Libratonator::CLI
- Inherits:
-
Object
- Object
- Libratonator::CLI
- Defined in:
- lib/libratonator/cli.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
5 6 7 8 9 |
# File 'lib/libratonator/cli.rb', line 5 def initialize Librato::Metrics.authenticate ENV['LIBRATO_EMAIL'], ENV['LIBRATO_KEY'] @parser = Parser.new @queue = Librato::Metrics::Queue.new(:autosubmit_interval => 60, :autosubmit_count => 400) end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
3 4 5 |
# File 'lib/libratonator/cli.rb', line 3 def parser @parser end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
3 4 5 |
# File 'lib/libratonator/cli.rb', line 3 def queue @queue end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 |
# File 'lib/libratonator/cli.rb', line 11 def run ARGF.each_line do |l| queue.add parser.parse(l) end queue.submit unless queue.size.zero? end |