Class: Elefant::Stats
Class Method Summary
collapse
Instance Method Summary
collapse
#size, #top_sizes
#activity, #summary, #user_indexes, #user_tables
Constructor Details
#initialize ⇒ Stats
Returns a new instance of Stats.
Class Method Details
.check! ⇒ Object
34
35
36
37
38
|
# File 'lib/elefant/stats.rb', line 34
def self.check!
connection = Elefant::ConnectionAdapter.new
raise ArgumentError.new("Could not establish connection") unless connection.alive?
connection.disconnect
end
|
Instance Method Details
#client_version ⇒ Object
22
23
24
|
# File 'lib/elefant/stats.rb', line 22
def client_version
@connection.info[:client_version]
end
|
#close! ⇒ Object
30
31
32
|
# File 'lib/elefant/stats.rb', line 30
def close!
@connection.disconnect
end
|
#db_name ⇒ Object
14
15
16
|
# File 'lib/elefant/stats.rb', line 14
def db_name
@connection.info[:db_name]
end
|
#get(name, params) ⇒ Object
26
27
28
|
# File 'lib/elefant/stats.rb', line 26
def get(name, params)
query(name, params)
end
|
#version ⇒ Object
18
19
20
|
# File 'lib/elefant/stats.rb', line 18
def version
@connection.info[:server_version]
end
|