Watch
0
0
Fork
You've already forked hyperhive
0

grafana: draw the forge change-size panels as bars that follow the time range

Average change size and the lines added and deleted panels drew one-line spikes:
the counters only exist while a repo is active and the rate over the short
rate interval left a gap everywhere else, so isolated pushes were hairlines, and
one repo's bulk import set the scale for the rest. They now draw bars of at most
40 buckets that follow the time range, and the average is the bucket's lines over
its merges on a logarithmic axis. No docs change: observability.md documents the
metrics, not the panels.
This commit is contained in:
iris 2026-11-25 18:50:01 +01:00 • committed by mara
commit dd17b20dac

View file

@ -2148,7 +2148,9 @@
}
],
"transformations": [],
"queryOptions": {}
"queryOptions": {
"maxDataPoints": 40
}
}
},
"vizConfig": {
@ -2176,12 +2178,16 @@
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"drawStyle": "bars",
"lineWidth": 1,
"fillOpacity": 0,
"fillOpacity": 80,
"showPoints": "never",
"spanNulls": false,
"axisSoftMin": 0
"axisSoftMin": 0,
"stacking": {
"mode": "normal",
"group": "A"
}
}
},
"overrides": []
@ -2222,7 +2228,9 @@
}
],
"transformations": [],
"queryOptions": {}
"queryOptions": {
"maxDataPoints": 40
}
}
},
"vizConfig": {
@ -2250,12 +2258,16 @@
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"drawStyle": "bars",
"lineWidth": 1,
"fillOpacity": 0,
"fillOpacity": 80,
"showPoints": "never",
"spanNulls": false,
"axisSoftMin": 0
"axisSoftMin": 0,
"stacking": {
"mode": "normal",
"group": "A"
}
}
},
"overrides": []
@ -2269,7 +2281,7 @@
"spec": {
"id": 26,
"title": "Average change size",
"description": "Lines added plus deleted per default-branch push, by repo.",
"description": "Lines changed per default-branch push, by repo; bar width follows the time range; log axis.",
"links": [],
"data": {
"kind": "QueryGroup",
@ -2286,7 +2298,7 @@
"name": "@datasourceUid@"
},
"spec": {
"expr": "sum by (repo) (rate({__name__=\"hyperhive.vcs.default_branch.lines_added\", \"service.name\"=\"swarm-controller\"}[$__rate_interval]) + rate({__name__=\"hyperhive.vcs.default_branch.lines_deleted\", \"service.name\"=\"swarm-controller\"}[$__rate_interval])) / sum by (repo) (rate({__name__=\"hyperhive.vcs.default_branch.merges\", \"service.name\"=\"swarm-controller\"}[$__rate_interval]))",
"expr": "sum by (repo) (increase({__name__=\"hyperhive.vcs.default_branch.lines_added\", \"service.name\"=\"swarm-controller\"}[$__interval]) + increase({__name__=\"hyperhive.vcs.default_branch.lines_deleted\", \"service.name\"=\"swarm-controller\"}[$__interval])) / sum by (repo) (increase({__name__=\"hyperhive.vcs.default_branch.merges\", \"service.name\"=\"swarm-controller\"}[$__interval]))",
"legendFormat": "{{repo}}"
}
},
@ -2296,7 +2308,9 @@
}
],
"transformations": [],
"queryOptions": {}
"queryOptions": {
"maxDataPoints": 40
}
}
},
"vizConfig": {
@ -2324,12 +2338,15 @@
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"drawStyle": "bars",
"lineWidth": 1,
"fillOpacity": 0,
"fillOpacity": 80,
"showPoints": "never",
"spanNulls": false,
"axisSoftMin": 0
"scaleDistribution": {
"type": "log",
"log": 10
}
}
},
"overrides": []