-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathutilization_by_mode.libsonnet
More file actions
45 lines (42 loc) · 1.68 KB
/
utilization_by_mode.libsonnet
File metadata and controls
45 lines (42 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local g = import '../../../g.libsonnet';
local base = import './base.libsonnet';
base {
new(
title='CPU usage by modes',
targets,
description='CPU usage by different modes.'
):
super.new(title, targets, description)
+ self.stylize(),
stylize(allLayers=true):
local timeSeries = g.panel.timeSeries;
local fieldOverride = g.panel.timeSeries.fieldOverride;
(if allLayers == true then super.stylize() else {})
+ timeSeries.standardOptions.withUnit('percent')
+ timeSeries.fieldConfig.defaults.custom.withFillOpacity(80)
+ timeSeries.fieldConfig.defaults.custom.withStacking({ mode: 'normal' })
+ timeSeries.standardOptions.withOverrides(
[
fieldOverride.byName.new('idle')
+ fieldOverride.byName.withPropertiesFromOptions(
timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.standardOptions.color.withFixedColor('light-blue'),
),
fieldOverride.byName.new('interrupt')
+ fieldOverride.byName.withPropertiesFromOptions(
timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.standardOptions.color.withFixedColor('light-purple'),
),
fieldOverride.byName.new('user')
+ fieldOverride.byName.withPropertiesFromOptions(
timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.standardOptions.color.withFixedColor('light-orange'),
),
fieldOverride.byRegexp.new('system|privileged')
+ fieldOverride.byRegexp.withPropertiesFromOptions(
timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.standardOptions.color.withFixedColor('light-red'),
),
]
),
}