[Before] Traceback (most recent call last): 3: from /home/wuzhende/compass-ci/sbin/es-jobs:55:in `<main>' 2: from /home/wuzhende/compass-ci/lib/es_jobs.rb:167:in `output' 1: from /home/wuzhende/compass-ci/lib/es_jobs.rb:137:in `query_jobs_state' /home/wuzhende/compass-ci/lib/es_jobs.rb:99:in `initialize_result_hash': undefined method `each' for nil:NilClass (NoMethodError)
[After] kvcount.category=benchmark: 1 kvcount.os=openeuler: 1 kvcount.suite=iperf: 1 kvcount.tbox_group=vm-2p16g: 1 raw.id.[arch=aarch64]: ["crystal.786605"] raw.id.[category=benchmark]: ["crystal.786605"] raw.id.[os=openeuler]: ["crystal.786605"] raw.id.[suite=iperf]: ["crystal.786605"] raw.id.[tbox_group=vm-2p16g]: ["crystal.786605"]
Signed-off-by: Wu Zhende wuzhende666@163.com --- lib/es_jobs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/es_jobs.rb b/lib/es_jobs.rb index eb3f70d..e367a91 100644 --- a/lib/es_jobs.rb +++ b/lib/es_jobs.rb @@ -84,7 +84,7 @@ class ESJobs
metrics.concat(stats.keys) end - metrics.uniq! + metrics.uniq end
def initialize_result_hash(metrics) @@ -137,11 +137,11 @@ class ESJobs metrics = get_all_metrics(jobs) result = initialize_result_hash(metrics) jobs.each do |job| + kvcount(result, job) stats = job['stats'] next unless stats
set_default_value(result, stats, metrics) - kvcount(result, job) end
stats_count(result)
On Tue, Jan 26, 2021 at 07:19:35PM +0800, Wu Zhende wrote:
[Before] Traceback (most recent call last): 3: from /home/wuzhende/compass-ci/sbin/es-jobs:55:in `<main>' 2: from /home/wuzhende/compass-ci/lib/es_jobs.rb:167:in `output' 1: from /home/wuzhende/compass-ci/lib/es_jobs.rb:137:in `query_jobs_state' /home/wuzhende/compass-ci/lib/es_jobs.rb:99:in `initialize_result_hash': undefined method `each' for nil:NilClass (NoMethodError)
I think the root cause is that "metrics.uniq!" return nil, you should add this in change log.
Thanks, Xueliang
[After] kvcount.category=benchmark: 1 kvcount.os=openeuler: 1 kvcount.suite=iperf: 1 kvcount.tbox_group=vm-2p16g: 1 raw.id.[arch=aarch64]: ["crystal.786605"] raw.id.[category=benchmark]: ["crystal.786605"] raw.id.[os=openeuler]: ["crystal.786605"] raw.id.[suite=iperf]: ["crystal.786605"] raw.id.[tbox_group=vm-2p16g]: ["crystal.786605"]
Signed-off-by: Wu Zhende wuzhende666@163.com
lib/es_jobs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/es_jobs.rb b/lib/es_jobs.rb index eb3f70d..e367a91 100644 --- a/lib/es_jobs.rb +++ b/lib/es_jobs.rb @@ -84,7 +84,7 @@ class ESJobs
metrics.concat(stats.keys) end
- metrics.uniq!
metrics.uniq end
def initialize_result_hash(metrics)
@@ -137,11 +137,11 @@ class ESJobs metrics = get_all_metrics(jobs) result = initialize_result_hash(metrics) jobs.each do |job|
kvcount(result, job) stats = job['stats'] next unless stats set_default_value(result, stats, metrics)
kvcount(result, job)
end
stats_count(result)
-- 2.23.0