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 '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 '
def nodeId: gsub(" "; "_") | gsub("\\."; "__");
.data[]
| { "FgLoad": "box", "BgLoad": "hexagon", "BgStartup": "ellipse" } as $shape
| { "PENDING": "white", "OK": "lightgreen", "FAILED": "red", "CANCELED": "darkred" } as $fillcolor
| [ "black", "blue", "orange", "yellow" ] as $color
| (.job | nodeId) as $self
| (.job_id | tostring) as $self
| [
# Nodes
$self + " [label=\"" + .job +
@ -35,7 +34,7 @@ $CLICKHOUSE_CLIENT --query='select job, status, is_blocked, is_ready, is_executi
"\"];",
# Edges
(.dependencies[] | ($self + " -> " + (. | nodeId) + ";"))
(.dependencies[] | ($self + " -> " + (. | tostring) + ";"))
]
| join("\n")
'