groonga-query-log 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/groonga-query-log-extract +3 -3
- data/doc/text/news.md +12 -0
- data/lib/groonga/query-log.rb +0 -1
- data/lib/groonga/query-log/analyzer/statistic.rb +2 -2
- data/lib/groonga/query-log/{extractor.rb → command/extract.rb} +22 -20
- data/lib/groonga/query-log/command/run-regression-test.rb +3 -2
- data/lib/groonga/query-log/version.rb +1 -1
- data/test/test-analyzer.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecc113262236c80addf12b23cf930c1d85cee8ae
|
4
|
+
data.tar.gz: b168f92861f723e4ede99f5b023a48050b52e8d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bdb3eabb1ad973af6a1f820ddf8263f14e05543db0864523b41a44e25ff4e84f220ec073778575067308677b41380adc4056e7f99141e51ad6c79b79d5c2fcd
|
7
|
+
data.tar.gz: a4712efb262754f0563b3458d7e25788a2844b4483d0cbb3cb31ba371402ce5aece3ec5e1c2ade38a5644340e6da91e800edcb03463e62add6d411b28d1b62f2
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# License along with this library; if not, write to the Free Software
|
18
18
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
19
|
|
20
|
-
require "groonga/query-log/
|
20
|
+
require "groonga/query-log/command/extract"
|
21
21
|
|
22
|
-
|
23
|
-
exit(
|
22
|
+
extract = Groonga::QueryLog::Command::Extract.new
|
23
|
+
exit(extract.run(ARGV))
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 1.1.5: 2015-08-12
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* groonga-query-log-run-regression-test: Changed to use `--file`
|
8
|
+
command line option of `groonga` instead of redirect to specify
|
9
|
+
input.
|
10
|
+
|
11
|
+
### Fixes
|
12
|
+
|
13
|
+
* groonga-query-log-extract: Fixed a bug that it fails to boot.
|
14
|
+
|
3
15
|
## 1.1.4: 2015-06-11
|
4
16
|
|
5
17
|
### Improvements
|
data/lib/groonga/query-log.rb
CHANGED
@@ -120,8 +120,8 @@ module Groonga
|
|
120
120
|
|
121
121
|
def to_hash
|
122
122
|
data = {
|
123
|
-
"start_time" => start_time.
|
124
|
-
"last_time" => last_time.
|
123
|
+
"start_time" => start_time.to_f,
|
124
|
+
"last_time" => last_time.to_f,
|
125
125
|
"elapsed" => elapsed_in_seconds,
|
126
126
|
"return_code" => return_code,
|
127
127
|
"slow" => slow?,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
# -*- coding: utf-8 -*-
|
3
2
|
#
|
4
3
|
# Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>
|
@@ -20,12 +19,14 @@
|
|
20
19
|
require "ostruct"
|
21
20
|
require "optparse"
|
22
21
|
require "pathname"
|
22
|
+
|
23
|
+
require "groonga/query-log"
|
23
24
|
require "groonga/query-log/command-line-utils"
|
24
|
-
require "groonga/query-log/parser"
|
25
25
|
|
26
26
|
module Groonga
|
27
27
|
module QueryLog
|
28
|
-
|
28
|
+
module Command
|
29
|
+
class Extract
|
29
30
|
include CommandLineUtils
|
30
31
|
|
31
32
|
class Error < StandardError
|
@@ -44,7 +45,7 @@ module Groonga
|
|
44
45
|
# "groonga-query-log-extract" command runs this method.
|
45
46
|
#
|
46
47
|
# @example
|
47
|
-
# extractor = Groonga::QueryLog::
|
48
|
+
# extractor = Groonga::QueryLog::Command::Extract.new
|
48
49
|
# extractor.run("--output", "commands.output",
|
49
50
|
# "--command", "select",
|
50
51
|
# "query.log")
|
@@ -97,19 +98,19 @@ module Groonga
|
|
97
98
|
|
98
99
|
available_formats = ["uri", "command"]
|
99
100
|
parser.on("--unify-format=FORMAT",
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
available_formats,
|
102
|
+
"Unify command format to FORMAT.",
|
103
|
+
"(#{available_formats.join(', ')})",
|
104
|
+
"[not unify]") do |format|
|
104
105
|
@options.unify_format = format
|
105
106
|
end
|
106
107
|
|
107
108
|
parser.on("--command=COMMAND",
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
109
|
+
"Extract only COMMAND.",
|
110
|
+
"To extract one or more commands,",
|
111
|
+
"specify this command a number of times.",
|
112
|
+
"Use /.../ as COMMAND to match command with regular expression.",
|
113
|
+
"[all commands]") do |command|
|
113
114
|
case command
|
114
115
|
when /\A\/(.*)\/(i)?\z/
|
115
116
|
@options.commands << Regexp.new($1, $2 == "i")
|
@@ -119,11 +120,11 @@ module Groonga
|
|
119
120
|
end
|
120
121
|
|
121
122
|
parser.on("--exclude-command=COMMAND",
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
123
|
+
"Don't extract COMMAND.",
|
124
|
+
"To ignore one or more commands,",
|
125
|
+
"specify this command a number of times.",
|
126
|
+
"Use /.../ as COMMAND to match command with regular expression.",
|
127
|
+
"[no commands]") do |command|
|
127
128
|
case command
|
128
129
|
when /\A\/(.*)\/(i)?\z/
|
129
130
|
@options.exclude_commands << Regexp.new($1, $2 == "i")
|
@@ -133,8 +134,8 @@ module Groonga
|
|
133
134
|
end
|
134
135
|
|
135
136
|
parser.on("--output=PATH",
|
136
|
-
|
137
|
-
|
137
|
+
"Output to PATH.",
|
138
|
+
"[standard output]") do |path|
|
138
139
|
@options.output_path = path
|
139
140
|
end
|
140
141
|
end
|
@@ -186,5 +187,6 @@ module Groonga
|
|
186
187
|
true
|
187
188
|
end
|
188
189
|
end
|
190
|
+
end
|
189
191
|
end
|
190
192
|
end
|
@@ -245,11 +245,12 @@ module Groonga
|
|
245
245
|
command = [
|
246
246
|
@groonga,
|
247
247
|
"--log-path", log_path.to_s,
|
248
|
+
"--file", grn_file.to_s,
|
248
249
|
@database_path.to_s,
|
249
250
|
]
|
250
|
-
command_line =
|
251
|
+
command_line = command.join(" ")
|
251
252
|
puts("Running...: #{command_line}")
|
252
|
-
pid = spawn(*command
|
253
|
+
pid = spawn(*command)
|
253
254
|
begin
|
254
255
|
pid, status = Process.waitpid2(pid)
|
255
256
|
rescue Interrupt
|
data/test/test-analyzer.rb
CHANGED
@@ -96,8 +96,8 @@ class AnalyzerTest < Test::Unit::TestCase
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def normalize_json(json)
|
99
|
-
json = json.gsub(/("start_time"):\d
|
100
|
-
json.gsub(/("last_time"):\d
|
99
|
+
json = json.gsub(/("start_time"):\d+(?:\.\d+)/, "\\1:START_TIME")
|
100
|
+
json.gsub(/("last_time"):\d+(?:\.\d+)/, "\\1:LAST_TIME")
|
101
101
|
end
|
102
102
|
|
103
103
|
def expected_analyzed_query(file_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-query-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: groonga-command-parser
|
@@ -198,12 +198,12 @@ files:
|
|
198
198
|
- lib/groonga/query-log/command-version-compatibility-checker.rb
|
199
199
|
- lib/groonga/query-log/command/check-command-version-compatibility.rb
|
200
200
|
- lib/groonga/query-log/command/detect-memory-leak.rb
|
201
|
+
- lib/groonga/query-log/command/extract.rb
|
201
202
|
- lib/groonga/query-log/command/format-regression-test-logs.rb
|
202
203
|
- lib/groonga/query-log/command/replay.rb
|
203
204
|
- lib/groonga/query-log/command/run-regression-test.rb
|
204
205
|
- lib/groonga/query-log/command/show-running-queries.rb
|
205
206
|
- lib/groonga/query-log/command/verify-server.rb
|
206
|
-
- lib/groonga/query-log/extractor.rb
|
207
207
|
- lib/groonga/query-log/incompatibility-detector.rb
|
208
208
|
- lib/groonga/query-log/memory-leak-detector.rb
|
209
209
|
- lib/groonga/query-log/parser.rb
|