groonga-query-log 1.7.5 → 1.7.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddc6abfd57bfd9684c695179c7cac74c76ea66fffb0b87b9a0d44726a16128b6
4
- data.tar.gz: 52dfaf4698c92587f155e3d4e0fd70fcc7c94b7c6ae58fdab43e72695a3e7722
3
+ metadata.gz: 5c1dd6a2bc5f431a4003c5468aa573a55563107a7eb875ef6af59b2150bb0ab9
4
+ data.tar.gz: 503abaf07344e2453e74bf34fd053560ce2bb3acce212527ea0559520167e81b
5
5
  SHA512:
6
- metadata.gz: 0747f843b5cce48e3540cace8c2be2ab4200c7d6c406917a56b7eb05dbd047437249400f25178045d29b1aef8c84253e6c3a70ef806db9f581ae47392a34c2a5
7
- data.tar.gz: 47391f44a1d86c8aa37ae8893f87381e49fddf15100762938cacb73b742b0a909c2b32e574564d32415c82e8ca2c5b618f0c86b0028c288b0570685a4b3f0d60
6
+ metadata.gz: ff08e69d1c1197d42fc763a685e2780e24c4e6432c3b04035b5076b1cd0fe126411fc36a8965da55abbde8cf94ac59a5032bc0028f52ceea6143abb5084c9f30
7
+ data.tar.gz: f4d689ada13d114ffce2f7d4d6d50ca6d38dbce1974a6df7fba5e9d677234d451de0da939aef0720f5876715d6d3848741cb8abbfeb12c005f6b0fa0983eb3b7
data/doc/text/news.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # News
2
2
 
3
+ ## 1.7.6: 2021-02-24
4
+
5
+ ### Improvements
6
+
7
+ * `replayer`: Ignored `load` without `values`.
8
+
9
+ * `statistics`: Added `n_records` to each operation.
10
+
3
11
  ## 1.7.5: 2020-11-18
4
12
 
5
13
  ### Improvements
@@ -47,6 +47,7 @@ module GroongaQueryLog
47
47
  parser.parse(input) do |statistic|
48
48
  next if statistic.command.nil?
49
49
  next unless target_command?(statistic.command)
50
+ next unless available_command?(statistic.command)
50
51
  # TODO: validate orignal_source is one line
51
52
  output.puts(statistic.command.original_source)
52
53
  output.flush
@@ -132,6 +133,15 @@ module GroongaQueryLog
132
133
  @options.target_command_name?(command.command_name)
133
134
  end
134
135
 
136
+ def available_command?(command)
137
+ case command.command_name
138
+ when "load"
139
+ not command.values.nil?
140
+ else
141
+ true
142
+ end
143
+ end
144
+
135
145
  class NullOutput
136
146
  class << self
137
147
  def open
@@ -152,6 +152,7 @@ module GroongaQueryLog
152
152
  operation_data["relative_elapsed"] = operation[:relative_elapsed_in_seconds]
153
153
  operation_data["context"] = operation[:context]
154
154
  operation_data["slow"] = operation[:slow?]
155
+ operation_data["n_records"] = operation[:n_records]
155
156
  operations << operation_data
156
157
  end
157
158
  data["operations"] = operations
@@ -15,5 +15,5 @@
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
  module GroongaQueryLog
18
- VERSION = "1.7.5"
18
+ VERSION = "1.7.6"
19
19
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
2
- # Copyright (C) 2014-2019 Sutou Kouhei <kou@clear-code.com>
2
+ # Copyright (C) 2014-2021 Sutou Kouhei <kou@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
5
5
  # modify it under the terms of the GNU Lesser General Public
@@ -42,6 +42,7 @@ class AnalyzerCommandTest < Test::Unit::TestCase
42
42
  end
43
43
 
44
44
  def test_no_specified
45
+ require_tty
45
46
  assert_equal("Error: Please specify input log files.\n",
46
47
  run_analyzer)
47
48
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
2
- # Copyright (C) 2015-2018 Kouhei Sutou <kou@clear-code.com>
2
+ # Copyright (C) 2015-2021 Sutou Kouhei <kou@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
5
5
  # modify it under the terms of the GNU Lesser General Public
@@ -45,6 +45,7 @@ column_create --flags "COLUMN_SCALAR" --name "title" --table "Comments" --type "
45
45
  end
46
46
 
47
47
  def test_no_specified
48
+ require_tty
48
49
  assert_equal("Error: Please specify input log files.\n",
49
50
  run_extractor)
50
51
  end
@@ -1,2 +1,2 @@
1
1
  {"start_time":START_TIME,"end_time":END_TIME,"elapsed":0.003128856,"return_code":0,"slow":false,"command":{"raw":"load --table Video","name":"load","parameters":[{"key":"table","value":"Video"}]},"operations":[]}
2
- {"start_time":START_TIME,"end_time":END_TIME,"elapsed":0.00121714,"return_code":0,"slow":false,"command":{"raw":"select --table Users --query follower:@groonga --output_columns _key,name","name":"select","parameters":[{"key":"table","value":"Users"},{"key":"query","value":"follower:@groonga"},{"key":"output_columns","value":"_key,name"}]},"operations":[{"name":"filter","relative_elapsed":0.0008429529999999999,"context":"Users.follower match \"groonga\"","slow":false},{"name":"select","relative_elapsed":2.7947e-05,"context":null,"slow":false},{"name":"output","relative_elapsed":0.000195852,"context":"_key,name","slow":false}]}
2
+ {"start_time":START_TIME,"end_time":END_TIME,"elapsed":0.00121714,"return_code":0,"slow":false,"command":{"raw":"select --table Users --query follower:@groonga --output_columns _key,name","name":"select","parameters":[{"key":"table","value":"Users"},{"key":"query","value":"follower:@groonga"},{"key":"output_columns","value":"_key,name"}]},"operations":[{"name":"filter","relative_elapsed":0.0008429529999999999,"context":"Users.follower match \"groonga\"","slow":false,"n_records":2},{"name":"select","relative_elapsed":2.7947e-05,"context":null,"slow":false,"n_records":2},{"name":"output","relative_elapsed":0.000195852,"context":"_key,name","slow":false,"n_records":2}]}
@@ -1,4 +1,4 @@
1
1
  [
2
2
  {"start_time":START_TIME,"end_time":END_TIME,"elapsed":0.003128856,"return_code":0,"slow":false,"command":{"raw":"load --table Video","name":"load","parameters":[{"key":"table","value":"Video"}]},"operations":[]},
3
- {"start_time":START_TIME,"end_time":END_TIME,"elapsed":0.00121714,"return_code":0,"slow":false,"command":{"raw":"select --table Users --query follower:@groonga --output_columns _key,name","name":"select","parameters":[{"key":"table","value":"Users"},{"key":"query","value":"follower:@groonga"},{"key":"output_columns","value":"_key,name"}]},"operations":[{"name":"filter","relative_elapsed":0.0008429529999999999,"context":"Users.follower match \"groonga\"","slow":false},{"name":"select","relative_elapsed":2.7947e-05,"context":null,"slow":false},{"name":"output","relative_elapsed":0.000195852,"context":"_key,name","slow":false}]}
3
+ {"start_time":START_TIME,"end_time":END_TIME,"elapsed":0.00121714,"return_code":0,"slow":false,"command":{"raw":"select --table Users --query follower:@groonga --output_columns _key,name","name":"select","parameters":[{"key":"table","value":"Users"},{"key":"query","value":"follower:@groonga"},{"key":"output_columns","value":"_key,name"}]},"operations":[{"name":"filter","relative_elapsed":0.0008429529999999999,"context":"Users.follower match \"groonga\"","slow":false,"n_records":2},{"name":"select","relative_elapsed":2.7947e-05,"context":null,"slow":false,"n_records":2},{"name":"output","relative_elapsed":0.000195852,"context":"_key,name","slow":false,"n_records":2}]}
4
4
  ]
data/test/helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2011-2017 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2011-2021 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -29,6 +29,10 @@ module Helper
29
29
  end
30
30
 
31
31
  module Command
32
+ def require_tty
33
+ omit("Require tty") unless $stdin.tty?
34
+ end
35
+
32
36
  def open_error_output
33
37
  Tempfile.open("groonga-query-log.error") do |error|
34
38
  error.sync = true
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.7.5
4
+ version: 1.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charty
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
315
  - !ruby/object:Gem::Version
316
316
  version: '0'
317
317
  requirements: []
318
- rubygems_version: 3.2.0.rc.2
318
+ rubygems_version: 3.3.0.dev
319
319
  signing_key:
320
320
  specification_version: 4
321
321
  summary: Groonga-query-log is a collection of library and tools to process [Groonga](http://groonga.org/)'s