Skip to content

Commit 55843ef

Browse files
authored
Merge pull request #163 from consideRatio/pr/cpu-units
Change CPU panels' units from percent to sishort (20% -> 200m)
2 parents 543364f + 24e544b commit 55843ef

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

dashboards/group.jsonnet

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ local cpuUsage =
6161
|||
6262
Per group CPU usage
6363
64+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
65+
6466
User groups are derived from authenticator managed groups where available, e.g. GitHub teams. If a user is a member of multiple groups, then they will be assigned to the group 'other' by default.
6567
6668
Requires https://github.com/2i2c-org/jupyterhub-groups-exporter to
6769
be set up. If the panels show no data, then please try selecting another time range where usage was active.
6870
|||
6971
)
70-
+ ts.standardOptions.withUnit('percentunit')
72+
+ ts.standardOptions.withUnit('sishort')
7173
+ ts.queryOptions.withTargets([
7274
prometheus.new(
7375
'$PROMETHEUS_DS',
@@ -205,13 +207,15 @@ local cpuRequests =
205207
|||
206208
Per group CPU requests
207209
210+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
211+
208212
User groups are derived from authenticator managed groups where available, e.g. GitHub teams. If a user is a member of multiple groups, then they will be assigned to the group 'other' by default.
209213
210214
Requires https://github.com/2i2c-org/jupyterhub-groups-exporter to
211215
be set up. If the panels show no data, then please try selecting another time range where usage was active.
212216
|||
213217
)
214-
+ ts.standardOptions.withUnit('percentunit')
218+
+ ts.standardOptions.withUnit('sishort')
215219
+ ts.queryOptions.withTargets([
216220
prometheus.new(
217221
'$PROMETHEUS_DS',

dashboards/jupyterhub.libsonnet

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ local prometheus = grafonnet.query.prometheus;
159159
irate(container_cpu_usage_seconds_total{name!=""}[5m])
160160
|||,
161161
)
162-
+ ts.standardOptions.withDecimals(1)
163-
+ ts.standardOptions.withUnit('percentunit'),
162+
+ ts.panelOptions.withDescription(
163+
|||
164+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
165+
|||
166+
)
167+
+ ts.standardOptions.withUnit('sishort'),
164168
}

dashboards/support.jsonnet

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ local nfsServerCPU =
4646
common.tsOptions
4747
+ common.tsRequestLimitStylingOverrides
4848
+ ts.new('NFS server CPU usage')
49+
+ ts.panelOptions.withDescription(
50+
|||
51+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
52+
|||
53+
)
4954
+ ts.standardOptions.withUnit('sishort')
5055
+ ts.queryOptions.withTargets([
5156
prometheus.new(
@@ -156,6 +161,11 @@ local promServerCPU =
156161
common.tsOptions
157162
+ common.tsRequestLimitStylingOverrides
158163
+ ts.new('Prometheus server CPU usage')
164+
+ ts.panelOptions.withDescription(
165+
|||
166+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
167+
|||
168+
)
159169
+ ts.standardOptions.withUnit('sishort')
160170
+ ts.queryOptions.withTargets([
161171
prometheus.new(

dashboards/user.jsonnet

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ local cpuUsage =
3838
+ ts.panelOptions.withDescription(
3939
|||
4040
Per user CPU usage
41+
42+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
4143
|||
4244
)
43-
+ ts.standardOptions.withUnit('percentunit')
45+
+ ts.standardOptions.withUnit('sishort')
4446
+ ts.queryOptions.withTargets([
4547
prometheus.new(
4648
'$PROMETHEUS_DS',
@@ -127,9 +129,11 @@ local cpuRequests =
127129
+ ts.panelOptions.withDescription(
128130
|||
129131
Per user CPU requests
132+
133+
The measured unit are CPU cores, and they are written out with SI prefixes, so 100m means 0.1 CPU cores.
130134
|||
131135
)
132-
+ ts.standardOptions.withUnit('percentunit')
136+
+ ts.standardOptions.withUnit('sishort')
133137
+ ts.queryOptions.withTargets([
134138
prometheus.new(
135139
'$PROMETHEUS_DS',

0 commit comments

Comments
 (0)