Class: Druid::Console
- Inherits:
-
Object
- Object
- Druid::Console
- Extended by:
- Forwardable
- Defined in:
- lib/druid/console.rb
Instance Method Summary collapse
- #client ⇒ Object
- #dimensions ⇒ Object
-
#initialize(uri, source, options) ⇒ Console
constructor
A new instance of Console.
- #metrics ⇒ Object
- #query ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(uri, source, options) ⇒ Console
Returns a new instance of Console.
43 44 45 46 |
# File 'lib/druid/console.rb', line 43 def initialize(uri, source, ) @uri, @source, @options = uri, source, Ripl.start(binding: binding) end |
Instance Method Details
#client ⇒ Object
48 49 50 51 52 |
# File 'lib/druid/console.rb', line 48 def client @client ||= Druid::Client.new(@uri, @options) @source ||= @client.data_sources[0] @client end |
#dimensions ⇒ Object
58 59 60 |
# File 'lib/druid/console.rb', line 58 def dimensions source.dimensions end |
#metrics ⇒ Object
62 63 64 |
# File 'lib/druid/console.rb', line 62 def metrics source.metrics end |
#query ⇒ Object
66 67 68 |
# File 'lib/druid/console.rb', line 66 def query client.query(@source) end |
#source ⇒ Object
54 55 56 |
# File 'lib/druid/console.rb', line 54 def source client.data_source(@source) end |