grntest 1.7.4 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +9 -0
- data/lib/grntest/executors/base-executor.rb +48 -18
- data/lib/grntest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9cd8b74ac4dd886a08f1550309a467d95b39f1adc182a915ace5bb10f7c0f78
|
4
|
+
data.tar.gz: ba6b74681a3a7523d0d48ed298efffb4d4d0fede4c0869401fba949e617f02b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d285a5183996b4390e93dac09e5416fd8f3e5decbadf4b8ed95458534e65cdd1d74b11efa6635d79e3687de7c7a09a83c1c2d2c6471b0455dfead94061158fdb
|
7
|
+
data.tar.gz: 2fbba81eeb21ebdfdebbcd51d758ad836b54f5017fb27b404025c4d0a930bbf686a71f397e73a0cb66de16c7d84e6231dc3662fc4cd907d201908281f0811494
|
data/doc/text/news.md
CHANGED
@@ -308,28 +308,43 @@ module Grntest
|
|
308
308
|
@context.collect_query_log = (options[0] == "true")
|
309
309
|
end
|
310
310
|
|
311
|
+
def each_generated_series_chunk(evaluator, start, stop)
|
312
|
+
max_chunk_size = 1 * 1024 * 1024 # 1MiB
|
313
|
+
chunk_size = 0
|
314
|
+
records = []
|
315
|
+
(Integer(start)..Integer(stop)).each do |i|
|
316
|
+
record = evaluator.evaluate(i: i).to_json
|
317
|
+
records << record
|
318
|
+
chunk_size += record.bytesize
|
319
|
+
if chunk_size > max_chunk_size
|
320
|
+
yield(records)
|
321
|
+
records.clear
|
322
|
+
chunk_size = 0
|
323
|
+
end
|
324
|
+
end
|
325
|
+
yield(records) unless records.empty?
|
326
|
+
end
|
327
|
+
|
311
328
|
def execute_directive_generate_series(parser, line, content, options)
|
312
329
|
start, stop, table, template, = options
|
313
330
|
evaluator = TemplateEvaluator.new(template.force_encoding("UTF-8"))
|
314
|
-
(
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
end
|
325
|
-
record << "\n"
|
326
|
-
record << evaluator.evaluate(i: i).to_json
|
327
|
-
before = Time.now
|
328
|
-
parser << record
|
329
|
-
elapsed = Time.now - before
|
330
|
-
Thread.pass if elapsed > 1.0
|
331
|
+
each_generated_series_chunk(evaluator,
|
332
|
+
Integer(start),
|
333
|
+
Integer(stop)) do |records|
|
334
|
+
source = "load --table #{table}\n"
|
335
|
+
values_part_start_position = source.size
|
336
|
+
source << "["
|
337
|
+
records.each_with_index do |record, i|
|
338
|
+
source << "," unless i.zero?
|
339
|
+
source << "\n"
|
340
|
+
source << record
|
331
341
|
end
|
332
|
-
|
342
|
+
source << "\n]"
|
343
|
+
values = source[values_part_start_position..-1]
|
344
|
+
command = Groonga::Command::Load.new(table: table, values: values)
|
345
|
+
command.original_source = source
|
346
|
+
execute_command(command)
|
347
|
+
Thread.pass
|
333
348
|
end
|
334
349
|
end
|
335
350
|
|
@@ -534,6 +549,19 @@ module Grntest
|
|
534
549
|
@benchmark_result = @noop_benchmark_result
|
535
550
|
end
|
536
551
|
|
552
|
+
def execute_directive_require_env(line, content, options)
|
553
|
+
env, = options
|
554
|
+
if env.start_with?("!")
|
555
|
+
if ENV[env[1..-1]]
|
556
|
+
omit("require env: #{env}")
|
557
|
+
end
|
558
|
+
else
|
559
|
+
unless ENV[env]
|
560
|
+
omit("require env: #{env}")
|
561
|
+
end
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
537
565
|
def execute_directive(parser, line, content)
|
538
566
|
command, *options = Shellwords.split(content)
|
539
567
|
case command
|
@@ -597,6 +625,8 @@ module Grntest
|
|
597
625
|
execute_directive_start_benchmark(line, content, options)
|
598
626
|
when "finish-benchmark"
|
599
627
|
execute_directive_finish_benchmark(line, content, options)
|
628
|
+
when "require-env"
|
629
|
+
execute_directive_require_env(line, content, options)
|
600
630
|
else
|
601
631
|
log_input(line)
|
602
632
|
log_error("#|e| unknown directive: <#{command}>")
|
data/lib/grntest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grntest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
- Haruka Yoshihara
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|