Class: SqlGenius::Core::Analysis::ServerOverview::Mysql
- Inherits:
-
Object
- Object
- SqlGenius::Core::Analysis::ServerOverview::Mysql
- Defined in:
- lib/sql_genius/core/analysis/server_overview.rb
Overview
MySQL / MariaDB implementation. Combines SHOW GLOBAL STATUS, SHOW GLOBAL VARIABLES, and SELECT VERSION() into the dashboard hash.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection) ⇒ Mysql
constructor
A new instance of Mysql.
Constructor Details
#initialize(connection) ⇒ Mysql
Returns a new instance of Mysql.
36 37 38 |
# File 'lib/sql_genius/core/analysis/server_overview.rb', line 36 def initialize(connection) @connection = connection end |
Instance Method Details
#call ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/sql_genius/core/analysis/server_overview.rb', line 40 def call status = load_status vars = load_variables version = @connection.select_value("SELECT VERSION()") uptime_seconds = status["Uptime"].to_i { server: server_block(version, uptime_seconds), connections: connections_block(status, vars), innodb: innodb_block(status, vars), queries: queries_block(status, uptime_seconds), } end |