reply on job_id instead of job name

This commit is contained in:
serxa 2023-06-03 15:17:05 +00:00
parent 443ec12f66
commit 27b7196961

View File

@ -18,14 +18,13 @@ CLICKHOUSE_CLIENT="$@"
echo 'digraph {' echo 'digraph {'
echo 'rankdir=LR;' echo 'rankdir=LR;'
$CLICKHOUSE_CLIENT --query='select job, status, is_blocked, is_ready, is_executing, pool, dependencies from system.async_loader FORMAT JSON' \ $CLICKHOUSE_CLIENT --query='select job, job_id, status, is_blocked, is_ready, is_executing, pool, dependencies from system.async_loader FORMAT JSON' \
| jq -r ' | jq -r '
def nodeId: gsub(" "; "_") | gsub("\\."; "__");
.data[] .data[]
| { "FgLoad": "box", "BgLoad": "hexagon", "BgStartup": "ellipse" } as $shape | { "FgLoad": "box", "BgLoad": "hexagon", "BgStartup": "ellipse" } as $shape
| { "PENDING": "white", "OK": "lightgreen", "FAILED": "red", "CANCELED": "darkred" } as $fillcolor | { "PENDING": "white", "OK": "lightgreen", "FAILED": "red", "CANCELED": "darkred" } as $fillcolor
| [ "black", "blue", "orange", "yellow" ] as $color | [ "black", "blue", "orange", "yellow" ] as $color
| (.job | nodeId) as $self | (.job_id | tostring) as $self
| [ | [
# Nodes # Nodes
$self + " [label=\"" + .job + $self + " [label=\"" + .job +
@ -35,7 +34,7 @@ $CLICKHOUSE_CLIENT --query='select job, status, is_blocked, is_ready, is_executi
"\"];", "\"];",
# Edges # Edges
(.dependencies[] | ($self + " -> " + (. | nodeId) + ";")) (.dependencies[] | ($self + " -> " + (. | tostring) + ";"))
] ]
| join("\n") | join("\n")
' '