Class: Mycmd::StatusCommands
- Inherits:
-
Thor
- Object
- Thor
- Mycmd::StatusCommands
- Defined in:
- lib/mycmd/cli/status_commands.rb
Instance Method Summary collapse
Instance Method Details
#innodb_buffer_hit_rate ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/mycmd/cli/status_commands.rb', line 29 def innodb_buffer_hit_rate begin print_rate(Client.query(SQL::INNODB_BUFFER_HIT_RATE).result, 90) rescue => e puts e. end end |
#qcache_hit_rate ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/mycmd/cli/status_commands.rb', line 19 def qcache_hit_rate begin raise "Query cache is disabled." if Client.query(SQL::QCACHE_SIZE).result.first["size"] == "0" print_rate(Client.query(SQL::QCACHE_HIT_RATE).result, 20) rescue => e puts e. end end |
#size ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/mycmd/cli/status_commands.rb', line 9 def size begin sql = ["database"].nil? ? SQL::ALL_DATABASE_SIZES : SQL.table_sizes(['database']) Client.query(sql).print rescue => e puts e. end end |