This commit is contained in:
mwiegand 2021-10-27 20:40:09 +02:00
parent ef461fec1c
commit da06f7cf06
3 changed files with 66 additions and 1 deletions

View file

@ -75,6 +75,9 @@ defaults = {
},
},
},
'grafana_rows': {
'zfs_arc',
},
'zfs': {
'datasets': {},
'pools': {},

View file

@ -7,8 +7,8 @@ from(bucket: "${bucket}")
% if function == 'derivative':
|> derivative(nonNegative: true)
% endif
|> aggregateWindow(every: duration(v: int(v: v.windowPeriod)*${resolution}), fn: mean, createEmpty: false)
% if negative:
|> map(fn: (r) => ({r with _value: r._value * - 1.0}))
% endif
|> aggregateWindow(every: duration(v: int(v: v.windowPeriod)*${resolution}), fn: mean, createEmpty: false)
|> yield(name: "mean")

View file

@ -0,0 +1,62 @@
{
'l2_size': {
'queries': {
'l2_size': {
'filters': {
'_measurement': 'zfs',
'_field': [
'arcstats_l2_size',
],
},
'function': 'mean',
},
},
'unit': 'bytes',
},
'l2_io': {
'queries': {
'read': {
'filters': {
'_measurement': 'zfs',
'_field': [
'arcstats_l2_read_bytes',
],
},
'function': 'derivative',
},
'write': {
'filters': {
'_measurement': 'zfs',
'_field': [
'arcstats_l2_write_bytes',
],
},
'function': 'derivative',
'negative': True,
},
},
},
'l2_cache_hits': {
'queries': {
'hits': {
'filters': {
'_measurement': 'zfs',
'_field': [
'arcstats_l2_hits',
],
},
'function': 'derivative',
},
'misses': {
'filters': {
'_measurement': 'zfs',
'_field': [
'arcstats_l2_misses',
],
},
'function': 'derivative',
'negative': True,
},
},
},
}