Skip to content

Commit 68f25d4

Browse files
dashboard: fix context switches panel
tnt_fiber_csw is not a monotonic metric since it summarize context switches over all current fibers. If fiber is already dead, its share is no more included. Thus, using rate on tnt_fiber_csw is incorrect. Follows up #72
1 parent 9330bcc commit 68f25d4

9 files changed

+24
-42
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
### Changed
2323
- Change replication status panel labels
2424

25+
### Fixed
26+
- Remove rate from fiber context switches panel
27+
2528

2629
## [1.1.0] - 2022-05-17
2730
Grafana revisions: [InfluxDB revision 10](https://grafana.com/api/dashboards/12567/revisions/10/download), [Prometheus revision 11](https://grafana.com/api/dashboards/13054/revisions/11/download)

dashboard/panels/runtime.libsonnet

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,26 @@ local common = import 'common.libsonnet';
8282
'last'
8383
)),
8484

85-
fiber_csw_rps(
85+
fiber_csw(
8686
title='Fiber context switches',
8787
description=|||
88-
Average rate of fiber context switches.
88+
Number of fiber context switches.
8989
Context switches are counted over all current fibers.
9090
|||,
9191
datasource=null,
9292
policy=null,
9393
measurement=null,
9494
job=null,
95-
rate_time_range=null,
9695
):: common.default_graph(
9796
title=title,
98-
description=common.rate_warning(description, datasource),
97+
description=description,
9998
datasource=datasource,
100-
labelY1='switches per second',
99+
labelY1='switches',
101100
panel_width=12,
102-
).addTarget(common.default_rps_target(
101+
).addTarget(common.default_metric_target(
103102
datasource,
104103
'tnt_fiber_csw',
105104
job,
106-
rate_time_range,
107105
policy,
108106
measurement
109107
)),

dashboard/section.libsonnet

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,11 @@ local tdg_tuples = import 'panels/tdg/tuples.libsonnet';
583583
job=job,
584584
),
585585

586-
runtime.fiber_csw_rps(
586+
runtime.fiber_csw(
587587
datasource=datasource,
588588
policy=policy,
589589
measurement=measurement,
590590
job=job,
591-
rate_time_range=rate_time_range,
592591
),
593592

594593
runtime.event_loop_time(

tests/InfluxDB/dashboard_compiled.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8239,7 +8239,7 @@
82398239
"dashes": false,
82408240
"datasource": "${DS_INFLUXDB}",
82418241
"decimals": 3,
8242-
"description": "Average rate of fiber context switches.\nContext switches are counted over all current fibers.\n",
8242+
"description": "Number of fiber context switches.\nContext switches are counted over all current fibers.\n",
82438243
"fill": 0,
82448244
"gridPos": {
82458245
"h": 8,
@@ -8313,12 +8313,6 @@
83138313
{
83148314
"params": [ ],
83158315
"type": "mean"
8316-
},
8317-
{
8318-
"params": [
8319-
"1s"
8320-
],
8321-
"type": "non_negative_derivative"
83228316
}
83238317
]
83248318
],
@@ -8352,7 +8346,7 @@
83528346
{
83538347
"decimals": 0,
83548348
"format": "none",
8355-
"label": "switches per second",
8349+
"label": "switches",
83568350
"logBase": 1,
83578351
"max": null,
83588352
"min": null,

tests/InfluxDB/dashboard_tdg_compiled.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7551,7 +7551,7 @@
75517551
"dashes": false,
75527552
"datasource": "${DS_INFLUXDB}",
75537553
"decimals": 3,
7554-
"description": "Average rate of fiber context switches.\nContext switches are counted over all current fibers.\n",
7554+
"description": "Number of fiber context switches.\nContext switches are counted over all current fibers.\n",
75557555
"fill": 0,
75567556
"gridPos": {
75577557
"h": 8,
@@ -7625,12 +7625,6 @@
76257625
{
76267626
"params": [ ],
76277627
"type": "mean"
7628-
},
7629-
{
7630-
"params": [
7631-
"1s"
7632-
],
7633-
"type": "non_negative_derivative"
76347628
}
76357629
]
76367630
],
@@ -7664,7 +7658,7 @@
76647658
{
76657659
"decimals": 0,
76667660
"format": "none",
7667-
"label": "switches per second",
7661+
"label": "switches",
76687662
"logBase": 1,
76697663
"max": null,
76707664
"min": null,

tests/InfluxDB/dashboard_with_custom_panels_compiled.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8239,7 +8239,7 @@
82398239
"dashes": false,
82408240
"datasource": "${DS_INFLUXDB}",
82418241
"decimals": 3,
8242-
"description": "Average rate of fiber context switches.\nContext switches are counted over all current fibers.\n",
8242+
"description": "Number of fiber context switches.\nContext switches are counted over all current fibers.\n",
82438243
"fill": 0,
82448244
"gridPos": {
82458245
"h": 8,
@@ -8313,12 +8313,6 @@
83138313
{
83148314
"params": [ ],
83158315
"type": "mean"
8316-
},
8317-
{
8318-
"params": [
8319-
"1s"
8320-
],
8321-
"type": "non_negative_derivative"
83228316
}
83238317
]
83248318
],
@@ -8352,7 +8346,7 @@
83528346
{
83538347
"decimals": 0,
83548348
"format": "none",
8355-
"label": "switches per second",
8349+
"label": "switches",
83568350
"logBase": 1,
83578351
"max": null,
83588352
"min": null,

tests/Prometheus/dashboard_compiled.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,7 +5906,7 @@
59065906
"dashes": false,
59075907
"datasource": "${DS_PROMETHEUS}",
59085908
"decimals": 3,
5909-
"description": "Average rate of fiber context switches.\nContext switches are counted over all current fibers.\n\n\nIf `No data` displayed, check up your 'rate_time_range' variable.",
5909+
"description": "Number of fiber context switches.\nContext switches are counted over all current fibers.\n",
59105910
"fill": 0,
59115911
"gridPos": {
59125912
"h": 8,
@@ -5944,7 +5944,7 @@
59445944
"steppedLine": false,
59455945
"targets": [
59465946
{
5947-
"expr": "rate(tnt_fiber_csw{job=~\"$job\"}[$rate_time_range])",
5947+
"expr": "tnt_fiber_csw{job=~\"$job\"}",
59485948
"format": "time_series",
59495949
"intervalFactor": 2,
59505950
"legendFormat": "{{alias}}",
@@ -5972,7 +5972,7 @@
59725972
{
59735973
"decimals": 0,
59745974
"format": "none",
5975-
"label": "switches per second",
5975+
"label": "switches",
59765976
"logBase": 1,
59775977
"max": null,
59785978
"min": null,

tests/Prometheus/dashboard_tdg_compiled.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,7 +5526,7 @@
55265526
"dashes": false,
55275527
"datasource": "${DS_PROMETHEUS}",
55285528
"decimals": 3,
5529-
"description": "Average rate of fiber context switches.\nContext switches are counted over all current fibers.\n\n\nIf `No data` displayed, check up your 'rate_time_range' variable.",
5529+
"description": "Number of fiber context switches.\nContext switches are counted over all current fibers.\n",
55305530
"fill": 0,
55315531
"gridPos": {
55325532
"h": 8,
@@ -5564,7 +5564,7 @@
55645564
"steppedLine": false,
55655565
"targets": [
55665566
{
5567-
"expr": "rate(tnt_fiber_csw{job=~\"$job\"}[$rate_time_range])",
5567+
"expr": "tnt_fiber_csw{job=~\"$job\"}",
55685568
"format": "time_series",
55695569
"intervalFactor": 2,
55705570
"legendFormat": "{{alias}}",
@@ -5592,7 +5592,7 @@
55925592
{
55935593
"decimals": 0,
55945594
"format": "none",
5595-
"label": "switches per second",
5595+
"label": "switches",
55965596
"logBase": 1,
55975597
"max": null,
55985598
"min": null,

tests/Prometheus/dashboard_with_custom_panels_compiled.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,7 +5906,7 @@
59065906
"dashes": false,
59075907
"datasource": "${DS_PROMETHEUS}",
59085908
"decimals": 3,
5909-
"description": "Average rate of fiber context switches.\nContext switches are counted over all current fibers.\n\n\nIf `No data` displayed, check up your 'rate_time_range' variable.",
5909+
"description": "Number of fiber context switches.\nContext switches are counted over all current fibers.\n",
59105910
"fill": 0,
59115911
"gridPos": {
59125912
"h": 8,
@@ -5944,7 +5944,7 @@
59445944
"steppedLine": false,
59455945
"targets": [
59465946
{
5947-
"expr": "rate(tnt_fiber_csw{job=~\"$job\"}[$rate_time_range])",
5947+
"expr": "tnt_fiber_csw{job=~\"$job\"}",
59485948
"format": "time_series",
59495949
"intervalFactor": 2,
59505950
"legendFormat": "{{alias}}",
@@ -5972,7 +5972,7 @@
59725972
{
59735973
"decimals": 0,
59745974
"format": "none",
5975-
"label": "switches per second",
5975+
"label": "switches",
59765976
"logBase": 1,
59775977
"max": null,
59785978
"min": null,

0 commit comments

Comments
 (0)