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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f5ad917944ca7bd674f39986f174b4654fd66ec
4
- data.tar.gz: 47e5fd5e81acda2018b453db2544653564d858b7
3
+ metadata.gz: ecc113262236c80addf12b23cf930c1d85cee8ae
4
+ data.tar.gz: b168f92861f723e4ede99f5b023a48050b52e8d3
5
5
  SHA512:
6
- metadata.gz: da229bc1ca6774432310b71320f295735ad0e755cb66e42fde36876465ad61989a2593f3f796df65d00dfea6551991fb49c0c847e78eca3376ed241d8c3913d8
7
- data.tar.gz: a1e34feb150710f80a0f9a49082285d195fb18948a148b76f8a25368ecddd0617a5c3c767fecf6adde9c7fb8823a046c43dc96efe43843e3c2ae160702817928
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/extractor"
20
+ require "groonga/query-log/command/extract"
21
21
 
22
- extracter = Groonga::QueryLog::Extractor.new
23
- exit(extracter.run(*ARGV))
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
@@ -18,7 +18,6 @@
18
18
 
19
19
  require "groonga/query-log/version"
20
20
  require "groonga/query-log/analyzer"
21
- require "groonga/query-log/extractor"
22
21
  require "groonga/query-log/parser"
23
22
  require "groonga/query-log/replayer"
24
23
  require "groonga/query-log/server-verifier"
@@ -120,8 +120,8 @@ module Groonga
120
120
 
121
121
  def to_hash
122
122
  data = {
123
- "start_time" => start_time.to_i,
124
- "last_time" => last_time.to_i,
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
- class Extractor
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::Extractor.new
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
- available_formats,
101
- "Unify command format to FORMAT.",
102
- "(#{available_formats.join(', ')})",
103
- "[not unify]") do |format|
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
- "Extract only COMMAND.",
109
- "To extract one or more commands,",
110
- "specify this command a number of times.",
111
- "Use /.../ as COMMAND to match command with regular expression.",
112
- "[all commands]") do |command|
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
- "Don't extract COMMAND.",
123
- "To ignore one or more commands,",
124
- "specify this command a number of times.",
125
- "Use /.../ as COMMAND to match command with regular expression.",
126
- "[no commands]") do |command|
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
- "Output to PATH.",
137
- "[standard output]") do |path|
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 = "#{command.join(' ')} < #{grn_file}"
251
+ command_line = command.join(" ")
251
252
  puts("Running...: #{command_line}")
252
- pid = spawn(*command, :in => grn_file.to_s)
253
+ pid = spawn(*command)
253
254
  begin
254
255
  pid, status = Process.waitpid2(pid)
255
256
  rescue Interrupt
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  module QueryLog
21
- VERSION = "1.1.4"
21
+ VERSION = "1.1.5"
22
22
  end
23
23
  end
@@ -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+/, "\\1:START_TIME")
100
- json.gsub(/("last_time"):\d+/, "\\1:LAST_TIME")
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
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-06-11 00:00:00.000000000 Z
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