Skip to content

Commit 0e718e2

Browse files
Merge pull request #100 from tarantool/99-cpu-in-percents
Show CPU time in percents
2 parents b8d6bc2 + f0a0bd7 commit 0e718e2

File tree

6 files changed

+53
-48
lines changed

6 files changed

+53
-48
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Changed
10+
- Show CPU time in percents
11+
12+
713
## [0.3.1] - 2021-07-08
814
Grafana revisions: [InfluxDB revision 6](https://grafana.com/api/dashboards/12567/revisions/6/download), [Prometheus revision 6](https://grafana.com/api/dashboards/13054/revisions/6/download)
915

dashboard/panels/cpu.libsonnet

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local common = import 'common.libsonnet';
33
{
44
row:: common.row('Tarantool CPU statistics'),
55

6-
local getrusage_cpu_time_graph(
6+
local getrusage_cpu_percentage_graph(
77
title,
88
description,
99
datasource,
@@ -16,9 +16,8 @@ local common = import 'common.libsonnet';
1616
title=title,
1717
description=description,
1818
datasource=datasource,
19-
format='s',
20-
labelY1='time per minute',
21-
decimalsY1=3,
19+
format='percentunit',
20+
decimalsY1=0,
2221
min=0,
2322
panel_width=12,
2423
).addTarget(common.default_rps_target(
@@ -34,7 +33,7 @@ local common = import 'common.libsonnet';
3433
title='CPU user time',
3534
description=|||
3635
Panel works with `metrics >= 0.8.0`.
37-
This is the average amount of time per minute
36+
This is the average share of time
3837
spent by instance process executing in user mode.
3938
Metrics obtained using `getrusage()` call.
4039
If `No data` displayed for Prometheus panel,
@@ -45,7 +44,7 @@ local common = import 'common.libsonnet';
4544
measurement=null,
4645
job=null,
4746
rate_time_range=null,
48-
):: getrusage_cpu_time_graph(
47+
):: getrusage_cpu_percentage_graph(
4948
title=title,
5049
description=description,
5150
datasource=datasource,
@@ -60,7 +59,7 @@ local common = import 'common.libsonnet';
6059
title='CPU system time',
6160
description=|||
6261
Panel works with `metrics >= 0.8.0`.
63-
This is the average amount of time per minute
62+
This is the average share of time
6463
spent by instance process executing in kernel mode.
6564
Metrics obtained using `getrusage()` call.
6665
If `No data` displayed for Prometheus panel,
@@ -71,7 +70,7 @@ local common = import 'common.libsonnet';
7170
measurement=null,
7271
job=null,
7372
rate_time_range=null,
74-
):: getrusage_cpu_time_graph(
73+
):: getrusage_cpu_percentage_graph(
7574
title=title,
7675
description=description,
7776
datasource=datasource,

tests/InfluxDB/dashboard_compiled.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5296,7 +5296,7 @@
52965296
"dashes": false,
52975297
"datasource": "${DS_INFLUXDB}",
52985298
"decimals": 3,
5299-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
5299+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
53005300
"fill": 0,
53015301
"gridPos": {
53025302
"h": 8,
@@ -5407,17 +5407,17 @@
54075407
},
54085408
"yaxes": [
54095409
{
5410-
"decimals": 3,
5411-
"format": "s",
5412-
"label": "time per minute",
5410+
"decimals": 0,
5411+
"format": "percentunit",
5412+
"label": null,
54135413
"logBase": 1,
54145414
"max": null,
54155415
"min": 0,
54165416
"show": true
54175417
},
54185418
{
54195419
"decimals": 3,
5420-
"format": "s",
5420+
"format": "percentunit",
54215421
"label": null,
54225422
"logBase": 1,
54235423
"max": null,
@@ -5433,7 +5433,7 @@
54335433
"dashes": false,
54345434
"datasource": "${DS_INFLUXDB}",
54355435
"decimals": 3,
5436-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
5436+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
54375437
"fill": 0,
54385438
"gridPos": {
54395439
"h": 8,
@@ -5544,17 +5544,17 @@
55445544
},
55455545
"yaxes": [
55465546
{
5547-
"decimals": 3,
5548-
"format": "s",
5549-
"label": "time per minute",
5547+
"decimals": 0,
5548+
"format": "percentunit",
5549+
"label": null,
55505550
"logBase": 1,
55515551
"max": null,
55525552
"min": 0,
55535553
"show": true
55545554
},
55555555
{
55565556
"decimals": 3,
5557-
"format": "s",
5557+
"format": "percentunit",
55585558
"label": null,
55595559
"logBase": 1,
55605560
"max": null,

tests/InfluxDB/dashboard_with_custom_panels_compiled.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5296,7 +5296,7 @@
52965296
"dashes": false,
52975297
"datasource": "${DS_INFLUXDB}",
52985298
"decimals": 3,
5299-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
5299+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
53005300
"fill": 0,
53015301
"gridPos": {
53025302
"h": 8,
@@ -5407,17 +5407,17 @@
54075407
},
54085408
"yaxes": [
54095409
{
5410-
"decimals": 3,
5411-
"format": "s",
5412-
"label": "time per minute",
5410+
"decimals": 0,
5411+
"format": "percentunit",
5412+
"label": null,
54135413
"logBase": 1,
54145414
"max": null,
54155415
"min": 0,
54165416
"show": true
54175417
},
54185418
{
54195419
"decimals": 3,
5420-
"format": "s",
5420+
"format": "percentunit",
54215421
"label": null,
54225422
"logBase": 1,
54235423
"max": null,
@@ -5433,7 +5433,7 @@
54335433
"dashes": false,
54345434
"datasource": "${DS_INFLUXDB}",
54355435
"decimals": 3,
5436-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
5436+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
54375437
"fill": 0,
54385438
"gridPos": {
54395439
"h": 8,
@@ -5544,17 +5544,17 @@
55445544
},
55455545
"yaxes": [
55465546
{
5547-
"decimals": 3,
5548-
"format": "s",
5549-
"label": "time per minute",
5547+
"decimals": 0,
5548+
"format": "percentunit",
5549+
"label": null,
55505550
"logBase": 1,
55515551
"max": null,
55525552
"min": 0,
55535553
"show": true
55545554
},
55555555
{
55565556
"decimals": 3,
5557-
"format": "s",
5557+
"format": "percentunit",
55585558
"label": null,
55595559
"logBase": 1,
55605560
"max": null,

tests/Prometheus/dashboard_compiled.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3904,7 +3904,7 @@
39043904
"dashes": false,
39053905
"datasource": "${DS_PROMETHEUS}",
39063906
"decimals": 3,
3907-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
3907+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
39083908
"fill": 0,
39093909
"gridPos": {
39103910
"h": 8,
@@ -3968,17 +3968,17 @@
39683968
},
39693969
"yaxes": [
39703970
{
3971-
"decimals": 3,
3972-
"format": "s",
3973-
"label": "time per minute",
3971+
"decimals": 0,
3972+
"format": "percentunit",
3973+
"label": null,
39743974
"logBase": 1,
39753975
"max": null,
39763976
"min": 0,
39773977
"show": true
39783978
},
39793979
{
39803980
"decimals": 3,
3981-
"format": "s",
3981+
"format": "percentunit",
39823982
"label": null,
39833983
"logBase": 1,
39843984
"max": null,
@@ -3994,7 +3994,7 @@
39943994
"dashes": false,
39953995
"datasource": "${DS_PROMETHEUS}",
39963996
"decimals": 3,
3997-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
3997+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
39983998
"fill": 0,
39993999
"gridPos": {
40004000
"h": 8,
@@ -4058,17 +4058,17 @@
40584058
},
40594059
"yaxes": [
40604060
{
4061-
"decimals": 3,
4062-
"format": "s",
4063-
"label": "time per minute",
4061+
"decimals": 0,
4062+
"format": "percentunit",
4063+
"label": null,
40644064
"logBase": 1,
40654065
"max": null,
40664066
"min": 0,
40674067
"show": true
40684068
},
40694069
{
40704070
"decimals": 3,
4071-
"format": "s",
4071+
"format": "percentunit",
40724072
"label": null,
40734073
"logBase": 1,
40744074
"max": null,

tests/Prometheus/dashboard_with_custom_panels_compiled.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3904,7 +3904,7 @@
39043904
"dashes": false,
39053905
"datasource": "${DS_PROMETHEUS}",
39063906
"decimals": 3,
3907-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
3907+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in user mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
39083908
"fill": 0,
39093909
"gridPos": {
39103910
"h": 8,
@@ -3968,17 +3968,17 @@
39683968
},
39693969
"yaxes": [
39703970
{
3971-
"decimals": 3,
3972-
"format": "s",
3973-
"label": "time per minute",
3971+
"decimals": 0,
3972+
"format": "percentunit",
3973+
"label": null,
39743974
"logBase": 1,
39753975
"max": null,
39763976
"min": 0,
39773977
"show": true
39783978
},
39793979
{
39803980
"decimals": 3,
3981-
"format": "s",
3981+
"format": "percentunit",
39823982
"label": null,
39833983
"logBase": 1,
39843984
"max": null,
@@ -3994,7 +3994,7 @@
39943994
"dashes": false,
39953995
"datasource": "${DS_PROMETHEUS}",
39963996
"decimals": 3,
3997-
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average amount of time per minute\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
3997+
"description": "Panel works with `metrics >= 0.8.0`.\nThis is the average share of time\nspent by instance process executing in kernel mode.\nMetrics obtained using `getrusage()` call.\nIf `No data` displayed for Prometheus panel,\ncheck up your 'rate_time_range' variable.\n",
39983998
"fill": 0,
39993999
"gridPos": {
40004000
"h": 8,
@@ -4058,17 +4058,17 @@
40584058
},
40594059
"yaxes": [
40604060
{
4061-
"decimals": 3,
4062-
"format": "s",
4063-
"label": "time per minute",
4061+
"decimals": 0,
4062+
"format": "percentunit",
4063+
"label": null,
40644064
"logBase": 1,
40654065
"max": null,
40664066
"min": 0,
40674067
"show": true
40684068
},
40694069
{
40704070
"decimals": 3,
4071-
"format": "s",
4071+
"format": "percentunit",
40724072
"label": null,
40734073
"logBase": 1,
40744074
"max": null,

0 commit comments

Comments
 (0)