groonga-query-log 1.6.7 → 1.6.8
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae04a296ec14c5c76495fed6305cbf2bd483ae3d1f75927c876d788deaa61ed
|
4
|
+
data.tar.gz: ae995f3d7b5bb5b93fdc380aa3cba02b6de0b5a5a356879c811190c3054fcd27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02049e8d2e93ad2f0c5564c7492e2b999e54feca6df4beadb1cc7555c25b31980a8b80c223c81873c63b6827f37a06ae340b7bb42ef943c24757632e1e9a115b'
|
7
|
+
data.tar.gz: db3778e5ebe80afc1b789cf8484d3ad65651d907388bd69e1c41fa5531fbe1fec4253af8bd5eee5e02d1ac6d53f108d43587cbd2aad2230bd7e493f8df304f64
|
data/doc/text/news.md
CHANGED
@@ -1,8 +1,17 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 1.6.8: 2020-05-30
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* `server-verifier`: Stopped sorting elapsed times.
|
8
|
+
|
9
|
+
* `run-regression-test`: Ensured killing Groonga server on start up
|
10
|
+
error.
|
11
|
+
|
3
12
|
## 1.6.7: 2020-05-30
|
4
13
|
|
5
|
-
###
|
14
|
+
### Improvements
|
6
15
|
|
7
16
|
* `extract`: Added support for no command request case such as `/`.
|
8
17
|
|
@@ -559,6 +559,7 @@ module GroongaQueryLog
|
|
559
559
|
@host = "127.0.0.1"
|
560
560
|
@port = find_unused_port
|
561
561
|
@options = options
|
562
|
+
@pid = nil
|
562
563
|
end
|
563
564
|
|
564
565
|
def run
|
@@ -579,25 +580,28 @@ module GroongaQueryLog
|
|
579
580
|
spawn_args << @database_path.to_s
|
580
581
|
@pid = spawn(*spawn_args)
|
581
582
|
|
582
|
-
n_retries = 10
|
583
583
|
begin
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
584
|
+
n_retries = 60
|
585
|
+
begin
|
586
|
+
send_command("status")
|
587
|
+
rescue SystemCallError
|
588
|
+
sleep(1)
|
589
|
+
n_retries -= 1
|
590
|
+
raise if n_retries.zero?
|
591
|
+
retry
|
592
|
+
end
|
591
593
|
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
594
|
+
if @options[:warm_up]
|
595
|
+
send_command("dump?dump_records=no")
|
596
|
+
warm_up_commands = @options[:warm_up_commands] || []
|
597
|
+
warm_up_commands.each do |command|
|
598
|
+
send_command(command)
|
599
|
+
end
|
597
600
|
end
|
601
|
+
rescue
|
602
|
+
shutdown
|
603
|
+
raise
|
598
604
|
end
|
599
|
-
|
600
|
-
yield if block_given?
|
601
605
|
end
|
602
606
|
|
603
607
|
def ensure_database
|
@@ -688,11 +692,14 @@ module GroongaQueryLog
|
|
688
692
|
end
|
689
693
|
|
690
694
|
def shutdown
|
695
|
+
return if @pid.nil?
|
691
696
|
begin
|
692
697
|
send_command("shutdown")
|
693
698
|
rescue SystemCallError
|
699
|
+
Process.kill(:KILL, @pid)
|
694
700
|
end
|
695
701
|
Process.waitpid(@pid)
|
702
|
+
@pid = nil
|
696
703
|
end
|
697
704
|
|
698
705
|
def n_leaked_objects
|
@@ -769,7 +776,6 @@ module GroongaQueryLog
|
|
769
776
|
@n_clients = options[:n_clients] || 1
|
770
777
|
@stop_on_failure = options[:stop_on_failure]
|
771
778
|
@options = options
|
772
|
-
@n_ready_waits = 2
|
773
779
|
@n_executed_commands = 0
|
774
780
|
end
|
775
781
|
|
@@ -777,21 +783,39 @@ module GroongaQueryLog
|
|
777
783
|
@old.ensure_database
|
778
784
|
@new.ensure_database
|
779
785
|
|
786
|
+
ready_queue = Thread::Queue.new
|
787
|
+
wait_queue = Thread::Queue.new
|
780
788
|
old_thread = Thread.new do
|
781
|
-
@old.run
|
782
|
-
|
789
|
+
@old.run
|
790
|
+
begin
|
791
|
+
ready_queue.push(true)
|
792
|
+
wait_queue.pop
|
793
|
+
ensure
|
794
|
+
@old.shutdown
|
783
795
|
end
|
784
796
|
end
|
785
797
|
new_thread = Thread.new do
|
786
|
-
@new.run
|
787
|
-
|
798
|
+
@new.run
|
799
|
+
begin
|
800
|
+
ready_queue.push(true)
|
801
|
+
wait_queue.pop
|
802
|
+
ensure
|
803
|
+
@new.shutdown
|
788
804
|
end
|
789
805
|
end
|
806
|
+
test_thread = Thread.new do
|
807
|
+
ready_queue.pop
|
808
|
+
ready_queue.pop
|
809
|
+
run_test
|
810
|
+
wait_queue.push(true)
|
811
|
+
wait_queue.push(true)
|
812
|
+
end
|
790
813
|
|
791
814
|
old_thread_success = old_thread.value
|
792
815
|
new_thread_success = new_thread.value
|
816
|
+
test_thread_success = test_thread.value
|
793
817
|
|
794
|
-
old_thread_success and new_thread_success
|
818
|
+
old_thread_success and new_thread_success and test_thread_success
|
795
819
|
end
|
796
820
|
|
797
821
|
def n_executed_commands
|
@@ -800,9 +824,6 @@ module GroongaQueryLog
|
|
800
824
|
|
801
825
|
private
|
802
826
|
def run_test
|
803
|
-
@n_ready_waits -= 1
|
804
|
-
return true unless @n_ready_waits.zero?
|
805
|
-
|
806
827
|
same = true
|
807
828
|
query_log_paths.each do |query_log_path|
|
808
829
|
log_path = test_log_path(query_log_path)
|
@@ -835,16 +856,6 @@ module GroongaQueryLog
|
|
835
856
|
puts("Interrupt: #{query_log_path}")
|
836
857
|
end
|
837
858
|
end
|
838
|
-
|
839
|
-
old_thread = Thread.new do
|
840
|
-
@old.shutdown
|
841
|
-
end
|
842
|
-
new_thread = Thread.new do
|
843
|
-
@new.shutdown
|
844
|
-
end
|
845
|
-
old_thread.join
|
846
|
-
new_thread.join
|
847
|
-
|
848
859
|
same
|
849
860
|
end
|
850
861
|
|
@@ -47,16 +47,16 @@ module GroongaQueryLog
|
|
47
47
|
diff_ratio > @threshold_ratio
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
51
|
-
|
50
|
+
def old_elapsed_times
|
51
|
+
collect_elapsed_times(@old_responses)
|
52
52
|
end
|
53
53
|
|
54
54
|
def old_elapsed_time
|
55
55
|
choose_target_elapsed_time(@old_responses)
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
59
|
-
|
58
|
+
def new_elapsed_times
|
59
|
+
collect_elapsed_times(@new_responses)
|
60
60
|
end
|
61
61
|
|
62
62
|
def new_elapsed_time
|
@@ -74,15 +74,14 @@ module GroongaQueryLog
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
def
|
78
|
-
|
77
|
+
def collect_elapsed_times(responses)
|
78
|
+
responses.collect do |response|
|
79
79
|
response.elapsed_time
|
80
80
|
end
|
81
|
-
elapsed_times.sort
|
82
81
|
end
|
83
82
|
|
84
83
|
def choose_target_elapsed_time(responses)
|
85
|
-
sorted_elapsed_times =
|
84
|
+
sorted_elapsed_times = collect_elapsed_times(responses).sort
|
86
85
|
|
87
86
|
strategy = @options.choose_strategy
|
88
87
|
case strategy
|
@@ -215,8 +215,8 @@ module GroongaQueryLog
|
|
215
215
|
command,
|
216
216
|
verifier.old_elapsed_time,
|
217
217
|
verifier.new_elapsed_time,
|
218
|
-
verifier.
|
219
|
-
verifier.
|
218
|
+
verifier.old_elapsed_time,
|
219
|
+
verifier.new_elapsed_time])
|
220
220
|
return
|
221
221
|
end
|
222
222
|
end
|
@@ -251,14 +251,14 @@ module GroongaQueryLog
|
|
251
251
|
command,
|
252
252
|
old_elapsed_time,
|
253
253
|
new_elapsed_time,
|
254
|
-
|
255
|
-
|
254
|
+
old_elapsed_times,
|
255
|
+
new_elapsed_times)
|
256
256
|
command_source = command.original_source || command.to_uri_format
|
257
257
|
output.puts("command: #{command_source}")
|
258
258
|
output.puts("elapsed_time_old: #{old_elapsed_time}")
|
259
259
|
output.puts("elapsed_time_new: #{new_elapsed_time}")
|
260
|
-
output.puts("elapsed_times_old: #{
|
261
|
-
output.puts("elapsed_times_new: #{
|
260
|
+
output.puts("elapsed_times_old: #{old_elapsed_times.join(' ')}")
|
261
|
+
output.puts("elapsed_times_new: #{new_elapsed_times.join(' ')}")
|
262
262
|
output.puts("elapsed_time_ratio: #{new_elapsed_time / old_elapsed_time}")
|
263
263
|
output.flush
|
264
264
|
end
|