log_magic 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/log_magic +11 -3
- data/lib/log_magic.rb +31 -12
- data/lib/log_magic/explainer_templates/mysql.haml +35 -0
- data/lib/log_magic/explainer_templates/mysql/WHERE.haml +2 -0
- data/lib/log_magic/explainer_templates/mysql/query.haml +2 -0
- data/lib/log_magic/explainer_templates/searchkick.haml +4 -0
- data/lib/log_magic/explainer_templates/{_all.haml → searchkick/_all.haml} +0 -0
- data/lib/log_magic/explainer_templates/{analyzer.haml → searchkick/analyzer.haml} +0 -0
- data/lib/log_magic/explainer_templates/{boost.haml → searchkick/boost.haml} +0 -0
- data/lib/log_magic/explainer_templates/{dis_max.haml → searchkick/dis_max.haml} +0 -0
- data/lib/log_magic/explainer_templates/{fuzzy_transpositions.haml → searchkick/fuzzy_transpositions.haml} +0 -0
- data/lib/log_magic/explainer_templates/{match.haml → searchkick/match.haml} +0 -0
- data/lib/log_magic/explainer_templates/{max_expansions.haml → searchkick/max_expansions.haml} +0 -0
- data/lib/log_magic/explainer_templates/{query.haml → searchkick/query.haml} +0 -0
- data/lib/log_magic/explainer_templates/{settings.haml → searchkick/settings.haml} +0 -0
- data/lib/log_magic/explainers/base_explainer.rb +21 -0
- data/lib/log_magic/explainers/msyql/query_explainer.rb +31 -0
- data/lib/log_magic/explainers/mysql/query_explainer.rb +31 -0
- data/lib/log_magic/explainers/mysql/where_explainer.rb +7 -0
- data/lib/log_magic/explainers/mysql_explainer.rb +26 -0
- data/lib/log_magic/explainers/{explainer_sections → searchkick}/_all_explainer.rb +0 -0
- data/lib/log_magic/explainers/searchkick/analyzer_explainer.rb +7 -0
- data/lib/log_magic/explainers/searchkick/boost_explainer.rb +7 -0
- data/lib/log_magic/explainers/{explainer_sections → searchkick}/custom_analyzer_hover.rb +0 -0
- data/lib/log_magic/explainers/searchkick/dis_max_explainer.rb +7 -0
- data/lib/log_magic/explainers/searchkick/fuzzy_transpositions_explainer.rb +7 -0
- data/lib/log_magic/explainers/searchkick/match_explainer.rb +7 -0
- data/lib/log_magic/explainers/{explainer_sections → searchkick}/max_expansions_section.rb +0 -0
- data/lib/log_magic/explainers/{explainer_sections → searchkick}/query_explainer.rb +0 -0
- data/lib/log_magic/explainers/{explainer_sections → searchkick}/settings_explainer.rb +0 -0
- data/lib/log_magic/explainers/searchkick_explainer.rb +3 -18
- data/lib/log_magic/persistance_layer.rb +1 -1
- data/lib/log_magic/printers/mysql_printer.rb +17 -0
- data/lib/log_magic/printers/searchkick_printer.rb +1 -1
- data/lib/log_magic/refiners/base_refiner.rb +15 -0
- data/lib/log_magic/refiners/mysql_refiner.rb +28 -0
- data/lib/log_magic/refiners/searchkick_refiner.rb +8 -14
- data/lib/log_magic/utils/templating_utils.rb +13 -3
- metadata +45 -20
- data/lib/log_magic/explainers/explainer_sections/analyzer_explainer.rb +0 -15
- data/lib/log_magic/explainers/explainer_sections/boost_explainer.rb +0 -15
- data/lib/log_magic/explainers/explainer_sections/dis_max_explainer.rb +0 -15
- data/lib/log_magic/explainers/explainer_sections/fuzzy_transpositions_explainer.rb +0 -15
- data/lib/log_magic/explainers/explainer_sections/match_explainer.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08cb4da5959a30e03917df67f8b639403bd947bd
|
4
|
+
data.tar.gz: d9ae174c0a9e17c48184cfc0a6237f1cdbe1c5f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b3a8cd289c129accc28b43e016b36db45fe90bdc488af5cc38210f397d36d9d8d6b65daa0238f90a79ae68c24345fea2dbd7fabda222ee949fdffb5a31b829b
|
7
|
+
data.tar.gz: 4dfd8a42fb2e1ad61d50512429eaf0476c4ceeaae744d71f02790a1a30d8ab31bd5180b62f32f796d43f3dc634b09c43e036e405c49370f39739f8dac2820560
|
data/bin/log_magic
CHANGED
@@ -5,14 +5,22 @@ require 'log_magic'
|
|
5
5
|
begin
|
6
6
|
log_magic = LogMagic.new(ARGV[0])
|
7
7
|
|
8
|
-
|
8
|
+
searchkick_server = fork do
|
9
9
|
explainer_server = LogMagic::SearchkickExplainer.new
|
10
10
|
explainer_server.start
|
11
11
|
end
|
12
|
-
Process.detach(
|
12
|
+
Process.detach(searchkick_server)
|
13
|
+
|
14
|
+
mysql_server = fork do
|
15
|
+
explainer_server = LogMagic::MySqlExplainer.new
|
16
|
+
explainer_server.start
|
17
|
+
end
|
18
|
+
Process.detach(mysql_server)
|
13
19
|
|
14
20
|
log_magic.initialize_listener
|
15
21
|
log_magic.start
|
16
22
|
ensure
|
17
|
-
|
23
|
+
[mysql_server, searchkick_server].each do |server|
|
24
|
+
`kill -9 #{server}` unless server.nil?
|
25
|
+
end
|
18
26
|
end
|
data/lib/log_magic.rb
CHANGED
@@ -1,17 +1,9 @@
|
|
1
1
|
require 'file-tail'
|
2
2
|
|
3
3
|
class LogMagic
|
4
|
-
attr_reader :persistance_layer
|
5
|
-
|
6
4
|
def initialize(log_file_name)
|
7
5
|
@log_file_name = log_file_name
|
8
|
-
|
9
|
-
@persistance_layer = PersistanceLayer.new
|
10
|
-
add_searchkick_refiner
|
11
|
-
end
|
12
|
-
|
13
|
-
def database_name
|
14
|
-
@persistance_layer.database_name
|
6
|
+
reset_refiners
|
15
7
|
end
|
16
8
|
|
17
9
|
def initialize_listener
|
@@ -22,8 +14,9 @@ class LogMagic
|
|
22
14
|
@log_listener.listen do |line|
|
23
15
|
add_line_to_refiners(line)
|
24
16
|
check_for_refiner_match do |refiner|
|
25
|
-
puts refiner.compute
|
17
|
+
puts refiner.compute
|
26
18
|
end
|
19
|
+
reset_refiners
|
27
20
|
end
|
28
21
|
end
|
29
22
|
|
@@ -44,21 +37,47 @@ class LogMagic
|
|
44
37
|
def add_searchkick_refiner
|
45
38
|
@refiners << SearchkickRefiner.new
|
46
39
|
end
|
40
|
+
|
41
|
+
def add_mysql_refiner
|
42
|
+
@refiners << MySqlRefiner.new
|
43
|
+
end
|
44
|
+
|
45
|
+
def reset_refiners
|
46
|
+
@refiners = []
|
47
|
+
add_searchkick_refiner
|
48
|
+
add_mysql_refiner
|
49
|
+
end
|
47
50
|
end
|
48
51
|
|
52
|
+
require 'active_support/all'
|
49
53
|
|
50
54
|
require 'log_magic/utils/json_utils'
|
51
55
|
require 'log_magic/utils/templating_utils'
|
56
|
+
|
52
57
|
require 'log_magic/log_listener'
|
58
|
+
|
59
|
+
require 'log_magic/refiners/base_refiner'
|
53
60
|
require 'log_magic/refiners/searchkick_refiner'
|
61
|
+
require 'log_magic/refiners/mysql_refiner'
|
62
|
+
|
54
63
|
require 'log_magic/printers/searchkick_printer'
|
64
|
+
require 'log_magic/printers/mysql_printer'
|
55
65
|
|
56
66
|
require 'log_magic/renderers/hover_renderer'
|
57
67
|
|
68
|
+
require 'log_magic/explainers/base_explainer'
|
58
69
|
require 'log_magic/explainers/searchkick_explainer'
|
70
|
+
require 'log_magic/explainers/mysql_explainer'
|
71
|
+
|
59
72
|
|
60
|
-
|
61
|
-
|
73
|
+
['searchkick', 'mysql'].each do |explainer_type|
|
74
|
+
explainer_files = \
|
75
|
+
File.expand_path(File.join(__FILE__, '..', "/log_magic/explainers/#{explainer_type}/"))
|
76
|
+
|
77
|
+
Dir.foreach(explainer_files).each do |explainer|
|
78
|
+
next if explainer == '.' || explainer == '..'
|
79
|
+
require File.join('log_magic', 'explainers', explainer_type, explainer)
|
80
|
+
end
|
62
81
|
end
|
63
82
|
|
64
83
|
require 'log_magic/persistance_layer'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
%head
|
2
|
+
%script{ src:"https://code.jquery.com/jquery-3.1.1.min.js", integrity:"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=", crossorigin:"anonymous" }
|
3
|
+
|
4
|
+
:javascript
|
5
|
+
$(document).ready(function() {
|
6
|
+
$('span.hover-key').mouseover(function(e) {
|
7
|
+
$(this).find('.hover-value').css('top', e.pageY);
|
8
|
+
$(this).find('.hover-value').css('left', e.pageX);
|
9
|
+
$(this).find('.hover-value').show();
|
10
|
+
});
|
11
|
+
|
12
|
+
$('span.hover-key').mouseout(function(e) {
|
13
|
+
$(this).find('span.hover-value').hide();
|
14
|
+
});
|
15
|
+
});
|
16
|
+
|
17
|
+
:css
|
18
|
+
.hover-value {
|
19
|
+
display: none;
|
20
|
+
position: absolute;
|
21
|
+
top: 20px;
|
22
|
+
left: 20px;
|
23
|
+
background-color: lightyellow;
|
24
|
+
color: purple;
|
25
|
+
padding: 20px;
|
26
|
+
border: purple 1px solid;
|
27
|
+
}
|
28
|
+
|
29
|
+
.hover-key {
|
30
|
+
cursor: pointer;
|
31
|
+
}
|
32
|
+
|
33
|
+
%body
|
34
|
+
%h2 Mysql
|
35
|
+
= explained_query.explanation
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/log_magic/explainer_templates/{max_expansions.haml → searchkick/max_expansions.haml}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class LogMagic::BaseExplainer
|
2
|
+
include ::LogMagic::JSONUtils
|
3
|
+
include ::LogMagic::TemplatingUtils
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@persistance_layer = ::LogMagic::PersistanceLayer.new
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def start
|
11
|
+
app = Proc.new do |env|
|
12
|
+
@uuid = env['PATH_INFO'][1..-1]
|
13
|
+
body = rendered_template
|
14
|
+
|
15
|
+
['200', {'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s}, [body]]
|
16
|
+
end
|
17
|
+
|
18
|
+
Rack::Handler::WEBrick.run app, Port: self.class.port_number,
|
19
|
+
Logger: WEBrick::Log::new('/tmp/log_magic.log')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class LogMagic::MySqlExplainer::QueryExplainerSection
|
2
|
+
include ::LogMagic::TemplatingUtils
|
3
|
+
attr_reader :mysql_query
|
4
|
+
|
5
|
+
def initialize(query_json)
|
6
|
+
@mysql_query = mysql_query
|
7
|
+
enriche_mysql_query
|
8
|
+
end
|
9
|
+
|
10
|
+
def explanation
|
11
|
+
rendered_template
|
12
|
+
end
|
13
|
+
|
14
|
+
def template_name
|
15
|
+
'query.haml'
|
16
|
+
end
|
17
|
+
|
18
|
+
def explainer_section_classes
|
19
|
+
[
|
20
|
+
::LogMagic::MySqlExplainer::WhereExplainerSection
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
24
|
+
def enriche_mysql_query
|
25
|
+
explainer_section_classes.map do |explainer_section_class|
|
26
|
+
explainer_section_class.new(mysql_query)
|
27
|
+
end.each do |explainer_section|
|
28
|
+
explainer_section.enriche
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class LogMagic::MySqlExplainer::QueryExplainerSection
|
2
|
+
include ::LogMagic::TemplatingUtils
|
3
|
+
attr_reader :mysql_query
|
4
|
+
|
5
|
+
def initialize(mysql_query)
|
6
|
+
@mysql_query = mysql_query
|
7
|
+
enriche_mysql_query
|
8
|
+
end
|
9
|
+
|
10
|
+
def explanation
|
11
|
+
rendered_template
|
12
|
+
end
|
13
|
+
|
14
|
+
def template_name
|
15
|
+
'query.haml'
|
16
|
+
end
|
17
|
+
|
18
|
+
def explainer_section_classes
|
19
|
+
[
|
20
|
+
::LogMagic::MySqlExplainer::WhereExplainerSection
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
24
|
+
def enriche_mysql_query
|
25
|
+
explainer_section_classes.map do |explainer_section_class|
|
26
|
+
explainer_section_class.new(mysql_query)
|
27
|
+
end.each do |explainer_section|
|
28
|
+
explainer_section.enriche
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rack'
|
2
|
+
require 'byebug'
|
3
|
+
require 'haml'
|
4
|
+
|
5
|
+
class LogMagic::MySqlExplainer < LogMagic::BaseExplainer
|
6
|
+
def self.port_number
|
7
|
+
7469
|
8
|
+
end
|
9
|
+
|
10
|
+
def mysql_query
|
11
|
+
# TODO: find root issue for why chomping \e[0m is necessary
|
12
|
+
mysql_query = @persistance_layer.retrieve_value(@uuid, 'mysql_query').chomp('[0m')
|
13
|
+
mysql_query = mysql_query[0..-2]
|
14
|
+
mysql_query
|
15
|
+
end
|
16
|
+
|
17
|
+
def explained_query
|
18
|
+
@query_explainer = QueryExplainerSection.new(mysql_query)
|
19
|
+
@query_explainer.enriche_mysql_query
|
20
|
+
@query_explainer
|
21
|
+
end
|
22
|
+
|
23
|
+
def template_name
|
24
|
+
'mysql.haml'
|
25
|
+
end
|
26
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,12 +2,9 @@ require 'rack'
|
|
2
2
|
require 'byebug'
|
3
3
|
require 'haml'
|
4
4
|
|
5
|
-
class LogMagic::SearchkickExplainer
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def initialize
|
10
|
-
@persistance_layer = ::LogMagic::PersistanceLayer.new
|
5
|
+
class LogMagic::SearchkickExplainer < LogMagic::BaseExplainer
|
6
|
+
def self.port_number
|
7
|
+
7467
|
11
8
|
end
|
12
9
|
|
13
10
|
def query_json
|
@@ -28,18 +25,6 @@ class LogMagic::SearchkickExplainer
|
|
28
25
|
@query_explainer
|
29
26
|
end
|
30
27
|
|
31
|
-
def start
|
32
|
-
app = Proc.new do |env|
|
33
|
-
@uuid = env['PATH_INFO'][1..-1]
|
34
|
-
body = rendered_template
|
35
|
-
|
36
|
-
['200', {'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s}, [body]]
|
37
|
-
end
|
38
|
-
|
39
|
-
Rack::Handler::WEBrick.run app, Port: 7467,
|
40
|
-
Logger: WEBrick::Log::new('/tmp/log_magic.log')
|
41
|
-
end
|
42
|
-
|
43
28
|
def template_name
|
44
29
|
'searchkick.haml'
|
45
30
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class LogMagic::MySqlPrinter
|
2
|
+
def initialize(mysql_query, uuid)
|
3
|
+
@mysql_query = mysql_query
|
4
|
+
@uuid = uuid
|
5
|
+
end
|
6
|
+
|
7
|
+
def print
|
8
|
+
"""
|
9
|
+
MySQL query generated by Rails
|
10
|
+
----
|
11
|
+
#{@mysql_query}
|
12
|
+
----
|
13
|
+
Copy and view in browser: http://localhost:#{::LogMagic::MySqlExplainer.port_number}/#{@uuid}
|
14
|
+
<------------------------------------------>
|
15
|
+
"""
|
16
|
+
end
|
17
|
+
end
|
@@ -9,7 +9,7 @@ class LogMagic::SearchkickPrinter
|
|
9
9
|
def print
|
10
10
|
"""
|
11
11
|
ElasticSearch query generated by Searchkick explained
|
12
|
-
Copy and view in browser: http://localhost
|
12
|
+
Copy and view in browser: http://localhost:#{::LogMagic::SearchkickExplainer.port_number}/#{@uuid}
|
13
13
|
<------------------------------------------>
|
14
14
|
"""
|
15
15
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class LogMagic::MySqlRefiner < LogMagic::BaseRefiner
|
2
|
+
def line_match_regex
|
3
|
+
/\w*\sLoad/
|
4
|
+
end
|
5
|
+
|
6
|
+
def compute
|
7
|
+
mysql_query = extract_mysql_query
|
8
|
+
persist_mysql_query(mysql_query)
|
9
|
+
output(mysql_query, persistance_layer.uuid)
|
10
|
+
end
|
11
|
+
|
12
|
+
def output(mysql_query, uuid)
|
13
|
+
mysql_printer = ::LogMagic::MySqlPrinter.new(mysql_query, uuid)
|
14
|
+
mysql_printer.print
|
15
|
+
end
|
16
|
+
|
17
|
+
def extract_mysql_query
|
18
|
+
@lines.last.match(load_sql_regex)[1]
|
19
|
+
end
|
20
|
+
|
21
|
+
def persist_mysql_query(mysql_query)
|
22
|
+
persistance_layer.add_value('mysql_query', mysql_query)
|
23
|
+
end
|
24
|
+
|
25
|
+
def load_sql_regex
|
26
|
+
/Load \([\d\.]+ms\)[^S]*(.*)/
|
27
|
+
end
|
28
|
+
end
|
@@ -1,20 +1,14 @@
|
|
1
|
-
class LogMagic::SearchkickRefiner
|
2
|
-
|
3
|
-
|
4
|
-
def initialize
|
5
|
-
@lines = []
|
6
|
-
end
|
7
|
-
|
8
|
-
def matches?
|
9
|
-
lines.last =~ /Search[^c]*curl/
|
1
|
+
class LogMagic::SearchkickRefiner < LogMagic::BaseRefiner
|
2
|
+
def line_match_regex
|
3
|
+
/Search[^c]*curl/
|
10
4
|
end
|
11
5
|
|
12
|
-
def compute
|
6
|
+
def compute
|
13
7
|
elasticsearch_url = extract_elasticsearch_url
|
14
|
-
persist_elasticsearch_url(
|
8
|
+
persist_elasticsearch_url(elasticsearch_url)
|
15
9
|
|
16
10
|
query_json = extract_query_json
|
17
|
-
persist_query_json(
|
11
|
+
persist_query_json(query_json)
|
18
12
|
|
19
13
|
output(query_json, persistance_layer.uuid)
|
20
14
|
end
|
@@ -32,11 +26,11 @@ class LogMagic::SearchkickRefiner
|
|
32
26
|
@lines.last.match(/https?:\/\/[^\/]*\/[^\/]*/)[0]
|
33
27
|
end
|
34
28
|
|
35
|
-
def persist_query_json(
|
29
|
+
def persist_query_json(query_json)
|
36
30
|
persistance_layer.add_value('query_json', query_json)
|
37
31
|
end
|
38
32
|
|
39
|
-
def persist_elasticsearch_url(
|
33
|
+
def persist_elasticsearch_url(elasticsearch_url)
|
40
34
|
persistance_layer.add_value('elasticsearch_url', elasticsearch_url)
|
41
35
|
end
|
42
36
|
end
|
@@ -9,9 +9,11 @@ module LogMagic::TemplatingUtils
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def template_path
|
12
|
-
File.expand_path(
|
13
|
-
File.join(__FILE__, '..', '..', template_dir, template_name)
|
12
|
+
file_name = File.expand_path(
|
13
|
+
file_name = File.join(__FILE__, '..', '..', template_dir, template_name)
|
14
14
|
)
|
15
|
+
fail("No template found for #{self.class.name}") unless File.exist?(file_name)
|
16
|
+
return file_name
|
15
17
|
end
|
16
18
|
|
17
19
|
def enriche
|
@@ -27,6 +29,14 @@ module LogMagic::TemplatingUtils
|
|
27
29
|
end
|
28
30
|
|
29
31
|
def template_dir
|
30
|
-
|
32
|
+
if self.class.name =~ /\w*::\w*::\w*/
|
33
|
+
if self.class.name =~ /LogMagic::SearchkickExplainer/
|
34
|
+
'explainer_templates/searchkick'
|
35
|
+
elsif self.class.name =~ /LogMagic::MySqlExplainer/
|
36
|
+
'explainer_templates/mysql'
|
37
|
+
end
|
38
|
+
else
|
39
|
+
'explainer_templates'
|
40
|
+
end
|
31
41
|
end
|
32
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_magic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Korfmann
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: byebug
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,30 +133,41 @@ files:
|
|
119
133
|
- bin/log_magic
|
120
134
|
- bin/rebuild
|
121
135
|
- lib/log_magic.rb
|
122
|
-
- lib/log_magic/explainer_templates/
|
123
|
-
- lib/log_magic/explainer_templates/
|
124
|
-
- lib/log_magic/explainer_templates/
|
125
|
-
- lib/log_magic/explainer_templates/dis_max.haml
|
126
|
-
- lib/log_magic/explainer_templates/fuzzy_transpositions.haml
|
127
|
-
- lib/log_magic/explainer_templates/match.haml
|
128
|
-
- lib/log_magic/explainer_templates/max_expansions.haml
|
129
|
-
- lib/log_magic/explainer_templates/query.haml
|
136
|
+
- lib/log_magic/explainer_templates/mysql.haml
|
137
|
+
- lib/log_magic/explainer_templates/mysql/WHERE.haml
|
138
|
+
- lib/log_magic/explainer_templates/mysql/query.haml
|
130
139
|
- lib/log_magic/explainer_templates/searchkick.haml
|
131
|
-
- lib/log_magic/explainer_templates/
|
132
|
-
- lib/log_magic/
|
133
|
-
- lib/log_magic/
|
134
|
-
- lib/log_magic/
|
135
|
-
- lib/log_magic/
|
136
|
-
- lib/log_magic/
|
137
|
-
- lib/log_magic/
|
138
|
-
- lib/log_magic/
|
139
|
-
- lib/log_magic/
|
140
|
-
- lib/log_magic/explainers/
|
141
|
-
- lib/log_magic/explainers/
|
140
|
+
- lib/log_magic/explainer_templates/searchkick/_all.haml
|
141
|
+
- lib/log_magic/explainer_templates/searchkick/analyzer.haml
|
142
|
+
- lib/log_magic/explainer_templates/searchkick/boost.haml
|
143
|
+
- lib/log_magic/explainer_templates/searchkick/dis_max.haml
|
144
|
+
- lib/log_magic/explainer_templates/searchkick/fuzzy_transpositions.haml
|
145
|
+
- lib/log_magic/explainer_templates/searchkick/match.haml
|
146
|
+
- lib/log_magic/explainer_templates/searchkick/max_expansions.haml
|
147
|
+
- lib/log_magic/explainer_templates/searchkick/query.haml
|
148
|
+
- lib/log_magic/explainer_templates/searchkick/settings.haml
|
149
|
+
- lib/log_magic/explainers/base_explainer.rb
|
150
|
+
- lib/log_magic/explainers/msyql/query_explainer.rb
|
151
|
+
- lib/log_magic/explainers/mysql/query_explainer.rb
|
152
|
+
- lib/log_magic/explainers/mysql/where_explainer.rb
|
153
|
+
- lib/log_magic/explainers/mysql_explainer.rb
|
154
|
+
- lib/log_magic/explainers/searchkick/_all_explainer.rb
|
155
|
+
- lib/log_magic/explainers/searchkick/analyzer_explainer.rb
|
156
|
+
- lib/log_magic/explainers/searchkick/boost_explainer.rb
|
157
|
+
- lib/log_magic/explainers/searchkick/custom_analyzer_hover.rb
|
158
|
+
- lib/log_magic/explainers/searchkick/dis_max_explainer.rb
|
159
|
+
- lib/log_magic/explainers/searchkick/fuzzy_transpositions_explainer.rb
|
160
|
+
- lib/log_magic/explainers/searchkick/match_explainer.rb
|
161
|
+
- lib/log_magic/explainers/searchkick/max_expansions_section.rb
|
162
|
+
- lib/log_magic/explainers/searchkick/query_explainer.rb
|
163
|
+
- lib/log_magic/explainers/searchkick/settings_explainer.rb
|
142
164
|
- lib/log_magic/explainers/searchkick_explainer.rb
|
143
165
|
- lib/log_magic/log_listener.rb
|
144
166
|
- lib/log_magic/persistance_layer.rb
|
167
|
+
- lib/log_magic/printers/mysql_printer.rb
|
145
168
|
- lib/log_magic/printers/searchkick_printer.rb
|
169
|
+
- lib/log_magic/refiners/base_refiner.rb
|
170
|
+
- lib/log_magic/refiners/mysql_refiner.rb
|
146
171
|
- lib/log_magic/refiners/searchkick_refiner.rb
|
147
172
|
- lib/log_magic/renderers/hover_renderer.rb
|
148
173
|
- lib/log_magic/util_templates/hovering.haml
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class LogMagic::SearchkickExplainer::AnalyzerExplainerSection
|
2
|
-
include ::LogMagic::TemplatingUtils
|
3
|
-
|
4
|
-
def initialize(query_json)
|
5
|
-
@query_json = query_json
|
6
|
-
end
|
7
|
-
|
8
|
-
def match_regex
|
9
|
-
/[^\w]analyzer[^\w]/
|
10
|
-
end
|
11
|
-
|
12
|
-
def template_name
|
13
|
-
'analyzer.haml'
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class LogMagic::SearchkickExplainer::BoostExplainerSection
|
2
|
-
include ::LogMagic::TemplatingUtils
|
3
|
-
|
4
|
-
def initialize(query_json)
|
5
|
-
@query_json = query_json
|
6
|
-
end
|
7
|
-
|
8
|
-
def match_regex
|
9
|
-
/[^\w]boost[^\w]/
|
10
|
-
end
|
11
|
-
|
12
|
-
def template_name
|
13
|
-
'boost.haml'
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class LogMagic::SearchkickExplainer::DisMaxExplainerSection
|
2
|
-
include ::LogMagic::TemplatingUtils
|
3
|
-
|
4
|
-
def initialize(query_json)
|
5
|
-
@query_json = query_json
|
6
|
-
end
|
7
|
-
|
8
|
-
def match_regex
|
9
|
-
/[^\w]dis_max[^\w]/
|
10
|
-
end
|
11
|
-
|
12
|
-
def template_name
|
13
|
-
'dis_max.haml'
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class LogMagic::SearchkickExplainer::FuzzyTranspositionsSection
|
2
|
-
include ::LogMagic::TemplatingUtils
|
3
|
-
|
4
|
-
def initialize(query_json)
|
5
|
-
@query_json = query_json
|
6
|
-
end
|
7
|
-
|
8
|
-
def match_regex
|
9
|
-
/[^\w]fuzzy_transpositions[^\w]/
|
10
|
-
end
|
11
|
-
|
12
|
-
def template_name
|
13
|
-
'fuzzy_transpositions.haml'
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class LogMagic::SearchkickExplainer::MatchExplainerSection
|
2
|
-
include ::LogMagic::TemplatingUtils
|
3
|
-
|
4
|
-
def initialize(query_json)
|
5
|
-
@query_json = query_json
|
6
|
-
end
|
7
|
-
|
8
|
-
def match_regex
|
9
|
-
/[^\w]match[^\w]/
|
10
|
-
end
|
11
|
-
|
12
|
-
def template_name
|
13
|
-
'match.haml'
|
14
|
-
end
|
15
|
-
end
|