[PATCH compass-ci] lib/sched.cr: change testbox's queues

[Before] ["sched/dc-8g.aarch64/ready"] [After] ["dc-8g.aarch64"] [Why] "sched/.*/ready" is a fixed format. The length of each column on kibana is limited, and removing the fixed format can also highlinght the point. Signed-off-by: Wu Zhende <wuzhende666@163.com> --- src/lib/sched.cr | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/sched.cr b/src/lib/sched.cr index f62f83e..35315ce 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -158,6 +158,16 @@ class Sched spawn mq_publish_confirm(JOB_MQ, mq_msg.to_json) end + # input: ["sched/dc-8g.aarch64/ready"] + # output: ["dc-8g.aarch64"] + def fetch_queues(queues) + new_queues = [] of String + queues.each do |queue| + new_queues << queue.split("/")[1] + end + new_queues + end + def set_lifecycle(job, testbox, queues) if job deadline = job.get_deadline @@ -172,7 +182,7 @@ class Sched end type = get_type(testbox) - queues = JSON.parse(queues.to_json) + queues = JSON.parse(fetch_queues(queues).to_json) hash = { "job_id" => job_id, "state" => state, -- 2.23.0
participants (1)
-
Wu Zhende