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.
45 46 47 48 |
# File 'lib/druid/console.rb', line 45 def initialize(uri, source, ) @uri, @source, @options = uri, source, Ripl.start(binding: binding) end |
Instance Method Details
#client ⇒ Object
50 51 52 53 54 |
# File 'lib/druid/console.rb', line 50 def client @client ||= Druid::Client.new(@uri, @options) @source ||= @client.data_sources[0] @client end |
#dimensions ⇒ Object
60 61 62 |
# File 'lib/druid/console.rb', line 60 def dimensions source.dimensions end |
#metrics ⇒ Object
64 65 66 |
# File 'lib/druid/console.rb', line 64 def metrics source.metrics end |
#query ⇒ Object
68 69 70 |
# File 'lib/druid/console.rb', line 68 def query client.query(@source) end |
#source ⇒ Object
56 57 58 |
# File 'lib/druid/console.rb', line 56 def source client.data_source(@source) end |