Add memory allocation rate panel to process dashboard
Change-Id: Iac41505fba6e4acd7bfde03b73ef0cd6cadbce96
diff --git a/dashboards/gerrit/process/gerrit-process.jsonnet b/dashboards/gerrit/process/gerrit-process.jsonnet
index 54a9790..ab657c7 100644
--- a/dashboards/gerrit/process/gerrit-process.jsonnet
+++ b/dashboards/gerrit/process/gerrit-process.jsonnet
@@ -16,6 +16,7 @@
local memory_panel = import './panels/memory.libsonnet';
local system_load_panel = import './panels/system-load.libsonnet';
local threads_panel = import './panels/threads.libsonnet';
+local allocation_panel = import './panels/allocation.libsonnet';
dashboard.new(
'Gerrit - Process',
@@ -50,11 +51,15 @@
gridPos=gridPos.new(2, 0)
)
.addPanel(
- file_descr_panel,
+ allocation_panel,
gridPos=gridPos.new(2, 1)
)
.addPanel(
jgit_block_cache_panel,
gridPos=gridPos.new(3, 0)
)
+.addPanel(
+ file_descr_panel,
+ gridPos=gridPos.new(3, 1)
+)
+ if std.extVar('publish') then publishVariables else {}
diff --git a/dashboards/gerrit/process/panels/allocation.libsonnet b/dashboards/gerrit/process/panels/allocation.libsonnet
new file mode 100644
index 0000000..d0c9161
--- /dev/null
+++ b/dashboards/gerrit/process/panels/allocation.libsonnet
@@ -0,0 +1,21 @@
+local grafana = import '../../../../vendor/grafonnet/grafana.libsonnet';
+local graphPanel = grafana.graphPanel;
+local prometheus = grafana.prometheus;
+
+local lineGraph = import '../../../globals/line-graph.libsonnet';
+local yAxis = import '../../../globals/yaxis.libsonnet';
+
+lineGraph.new(
+ title='Memory Allocation',
+ yAxis1=yAxis.new(
+ label='Memory Allocation Rate',
+ format='Bps',
+ logBase=10,
+ ),
+)
+.addTarget(
+ prometheus.target(
+ 'rate(proc_jvm_memory_allocated{instance="$instance",replica="$replica"}[$__rate_interval])',
+ legendFormat='memory allocation rate',
+ )
+)