Class: LogMagic::MySqlExplainer

Inherits:
BaseExplainer show all
Defined in:
lib/log_magic/explainers/mysql_explainer.rb

Defined Under Namespace

Classes: IsNullExplainerSection, OrderByExplainerSection, QueryExplainerSection, SelectExplainerSection, WhereExplainerSection

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseExplainer

#initialize, #start

Methods included from TemplatingUtils

#enriche, #initialize, #match_regex, #rendered_template, #template_dir, #template_path

Methods included from JSONUtils

#parse_json, #pretty_print_json, #query_hash

Constructor Details

This class inherits a constructor from LogMagic::BaseExplainer

Class Method Details

.port_numberObject



6
7
8
# File 'lib/log_magic/explainers/mysql_explainer.rb', line 6

def self.port_number
  7469
end

Instance Method Details

#explained_queryObject



17
18
19
20
21
# File 'lib/log_magic/explainers/mysql_explainer.rb', line 17

def explained_query
  @query_explainer = QueryExplainerSection.new(mysql_query)
  @query_explainer.enriche_mysql_query
  @query_explainer
end

#mysql_queryObject



10
11
12
13
14
15
# File 'lib/log_magic/explainers/mysql_explainer.rb', line 10

def mysql_query
  # TODO: find root issue for why chomping \e[0m is necessary
  mysql_query = @persistance_layer.retrieve_value(@uuid, 'mysql_query').chomp('[0m')
  mysql_query = mysql_query[0..-2]
  mysql_query
end

#template_nameObject



23
24
25
# File 'lib/log_magic/explainers/mysql_explainer.rb', line 23

def template_name
  'mysql.haml'
end