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 +4 -4
- data/doc/text/news.md +8 -0
- data/lib/groonga-query-log/replayer.rb +10 -0
- data/lib/groonga-query-log/statistic.rb +1 -0
- data/lib/groonga-query-log/version.rb +1 -1
- data/test/command/test-analyzer.rb +2 -1
- data/test/command/test-extract.rb +2 -1
- data/test/fixtures/reporter/json-stream.expected +1 -1
- data/test/fixtures/reporter/json.expected +1 -1
- data/test/helper.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c1dd6a2bc5f431a4003c5468aa573a55563107a7eb875ef6af59b2150bb0ab9
|
4
|
+
data.tar.gz: 503abaf07344e2453e74bf34fd053560ce2bb3acce212527ea0559520167e81b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff08e69d1c1197d42fc763a685e2780e24c4e6432c3b04035b5076b1cd0fe126411fc36a8965da55abbde8cf94ac59a5032bc0028f52ceea6143abb5084c9f30
|
7
|
+
data.tar.gz: f4d689ada13d114ffce2f7d4d6d50ca6d38dbce1974a6df7fba5e9d677234d451de0da939aef0720f5876715d6d3848741cb8abbfeb12c005f6b0fa0983eb3b7
|
data/doc/text/news.md
CHANGED
@@ -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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
|
2
|
-
# Copyright (C) 2014-
|
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-
|
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-
|
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.
|
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:
|
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.
|
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
|