monitoring(overview): restore jenkins panel readability with top-6 stat rows
This commit is contained in:
parent
8db72c9475
commit
99e7dababd
@ -1608,106 +1608,6 @@ def jenkins_weather_statlist_panel(
|
||||
return panel
|
||||
|
||||
|
||||
def jenkins_weather_scroll_table_panel(
|
||||
panel_id,
|
||||
title,
|
||||
expr,
|
||||
grid,
|
||||
*,
|
||||
unit="h",
|
||||
decimals=1,
|
||||
sort_order="asc",
|
||||
links=None,
|
||||
description=None,
|
||||
):
|
||||
table = table_panel(
|
||||
panel_id,
|
||||
title,
|
||||
expr,
|
||||
grid,
|
||||
unit=unit,
|
||||
targets=[
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": _jenkins_weather_status_expr(expr, "== 1"),
|
||||
"instant": True,
|
||||
"format": "table",
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": _jenkins_weather_status_expr(expr, "!= 1"),
|
||||
"instant": True,
|
||||
"format": "table",
|
||||
},
|
||||
],
|
||||
instant=True,
|
||||
format="table",
|
||||
filterable=False,
|
||||
options={"showHeader": False, "columnFilters": False, "cellHeight": "sm"},
|
||||
footer={"show": False, "fields": "", "calcs": []},
|
||||
transformations=[
|
||||
{"id": "labelsToFields", "options": {}},
|
||||
{"id": "sortBy", "options": {"fields": ["Value"], "order": sort_order}},
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {
|
||||
"excludeByName": {"Time": True, "job_url": True},
|
||||
"renameByName": {"weather_icon": "", "exported_job": "Job", "Value": "h"},
|
||||
},
|
||||
},
|
||||
],
|
||||
field_overrides=[
|
||||
{
|
||||
"matcher": {"id": "byName", "options": "weather_icon"},
|
||||
"properties": [
|
||||
{"id": "custom.width", "value": 26},
|
||||
{"id": "custom.align", "value": "center"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"matcher": {"id": "byName", "options": "exported_job"},
|
||||
"properties": [
|
||||
{"id": "custom.width", "value": 190},
|
||||
{
|
||||
"id": "links",
|
||||
"value": [
|
||||
{
|
||||
"title": "Open Jenkins job",
|
||||
"url": "https://ci.bstein.dev/job/${__value.raw}/",
|
||||
"targetBlank": True,
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"matcher": {"id": "byName", "options": "Value"},
|
||||
"properties": [
|
||||
{"id": "decimals", "value": decimals},
|
||||
{"id": "custom.width", "value": 74},
|
||||
{"id": "custom.align", "value": "right"},
|
||||
{"id": "custom.cellOptions", "value": {"type": "color-text"}},
|
||||
],
|
||||
},
|
||||
{
|
||||
"matcher": {"id": "byFrameRefID", "options": "A"},
|
||||
"properties": [
|
||||
{"id": "color", "value": {"mode": "fixed", "fixedColor": "green"}},
|
||||
],
|
||||
},
|
||||
{
|
||||
"matcher": {"id": "byFrameRefID", "options": "B"},
|
||||
"properties": [
|
||||
{"id": "color", "value": {"mode": "fixed", "fixedColor": "red"}},
|
||||
],
|
||||
},
|
||||
],
|
||||
links=links,
|
||||
description=description,
|
||||
)
|
||||
return table
|
||||
|
||||
|
||||
def text_panel(panel_id, title, content, grid):
|
||||
return {
|
||||
"id": panel_id,
|
||||
@ -2297,13 +2197,14 @@ def build_overview():
|
||||
unit="h",
|
||||
decimals=1,
|
||||
sort_order="asc",
|
||||
limit=None,
|
||||
limit=6,
|
||||
title_size=11,
|
||||
value_size=11,
|
||||
links=link_to("atlas-jobs"),
|
||||
description=(
|
||||
"List of Jenkins jobs ordered by age since most recent successful run (newest first). "
|
||||
"Green means last run succeeded; red means last run did not succeed."
|
||||
"Top 6 most recent Jenkins successes by age (newest first). "
|
||||
"Green means last run succeeded; red means last run did not succeed. "
|
||||
"Use Atlas Jobs for the full list."
|
||||
),
|
||||
)
|
||||
)
|
||||
@ -2316,13 +2217,14 @@ def build_overview():
|
||||
unit="h",
|
||||
decimals=1,
|
||||
sort_order="asc",
|
||||
limit=None,
|
||||
limit=6,
|
||||
title_size=11,
|
||||
value_size=11,
|
||||
links=link_to("atlas-jobs"),
|
||||
description=(
|
||||
"List of Jenkins jobs ordered by age since most recent failed run (newest first). "
|
||||
"Green means last run succeeded; red means last run did not succeed."
|
||||
"Top 6 most recent Jenkins failures by age (newest first). "
|
||||
"Green means last run succeeded; red means last run did not succeed. "
|
||||
"Use Atlas Jobs for the full list."
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
@ -2425,6 +2425,12 @@
|
||||
],
|
||||
"order": "asc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "limit",
|
||||
"options": {
|
||||
"limit": 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
@ -2434,7 +2440,7 @@
|
||||
"targetBlank": true
|
||||
}
|
||||
],
|
||||
"description": "List of Jenkins jobs ordered by age since most recent successful run (newest first). Green means last run succeeded; red means last run did not succeed."
|
||||
"description": "Top 6 most recent Jenkins successes by age (newest first). Green means last run succeeded; red means last run did not succeed. Use Atlas Jobs for the full list."
|
||||
},
|
||||
{
|
||||
"id": 243,
|
||||
@ -2580,6 +2586,12 @@
|
||||
],
|
||||
"order": "asc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "limit",
|
||||
"options": {
|
||||
"limit": 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
@ -2589,7 +2601,7 @@
|
||||
"targetBlank": true
|
||||
}
|
||||
],
|
||||
"description": "List of Jenkins jobs ordered by age since most recent failed run (newest first). Green means last run succeeded; red means last run did not succeed."
|
||||
"description": "Top 6 most recent Jenkins failures by age (newest first). Green means last run succeeded; red means last run did not succeed. Use Atlas Jobs for the full list."
|
||||
},
|
||||
{
|
||||
"id": 47,
|
||||
|
||||
@ -2434,6 +2434,12 @@ data:
|
||||
],
|
||||
"order": "asc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "limit",
|
||||
"options": {
|
||||
"limit": 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
@ -2443,7 +2449,7 @@ data:
|
||||
"targetBlank": true
|
||||
}
|
||||
],
|
||||
"description": "List of Jenkins jobs ordered by age since most recent successful run (newest first). Green means last run succeeded; red means last run did not succeed."
|
||||
"description": "Top 6 most recent Jenkins successes by age (newest first). Green means last run succeeded; red means last run did not succeed. Use Atlas Jobs for the full list."
|
||||
},
|
||||
{
|
||||
"id": 243,
|
||||
@ -2589,6 +2595,12 @@ data:
|
||||
],
|
||||
"order": "asc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "limit",
|
||||
"options": {
|
||||
"limit": 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
@ -2598,7 +2610,7 @@ data:
|
||||
"targetBlank": true
|
||||
}
|
||||
],
|
||||
"description": "List of Jenkins jobs ordered by age since most recent failed run (newest first). Green means last run succeeded; red means last run did not succeed."
|
||||
"description": "Top 6 most recent Jenkins failures by age (newest first). Green means last run succeeded; red means last run did not succeed. Use Atlas Jobs for the full list."
|
||||
},
|
||||
{
|
||||
"id": 47,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user