00
  /   ˆl–ß=¿J*h¥8 p\iõ1hßÃ„Àu¯_ŠI|¥�+õJi¿ÂÁ ?÷     #
# Copyright (C) 2016-2021 Red Hat.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# 
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#

#
# IOSTAT derived metrics (per-device for regular block devices)
# These derived metrics complement the disk.dev.* metrics tree.
# Note:
#	not all the base disk.dev.* metrics are available for some
#	platforms (e.g. *BSD systems), so the defined(x) predicates
#	are used to guard the expressions ... the guards are not
#       exhaustive and have been simplified to use the _least_ widely
#	available metrics, because if these are not in the PMNS then
#	the _more_ likely metrics won't be there
# Note:
#	we use disk.dev.read to provide the indom for disk.dev.await,
#	then chain all the remaining metadata off disk.dev.await
#

disk.dev.await = defined(disk.dev.total_rawactive) ? \
    (delta(disk.dev.total) == 0 ? \
	mkconst(0, meta=disk.dev.read, type=double, semantics=instant, units="millisec/count") \
	: delta(disk.dev.total_rawactive) / delta(disk.dev.total)) \
    : novalue(meta=disk.dev.read, type=double, semantics=instant, units="millisec/count")
disk.dev.await(oneline) = average time read and write requests queued and serviced
disk.dev.await(helptext) = '\
average time in milliseconds that read and write requests
were queued (and serviced) during the reporting interval.'

disk.dev.r_await = defined(disk.dev.read_rawactive) ? \
    (delta(disk.dev.read) == 0 ? \
	mkconst(0, meta=disk.dev.await) \
	: delta(disk.dev.read_rawactive) / delta(disk.dev.read)) \
    : novalue(meta=disk.dev.await)
disk.dev.r_await(oneline) = average time read requests queued and serviced 
disk.dev.r_await(helptext) = '\
average time in milliseconds that read requests were queued
(and serviced) during the reporting interval.'

disk.dev.w_await = defined(disk.dev.write_rawactive) ? \
    (delta(disk.dev.write) == 0 ? \
	mkconst(0, meta=disk.dev.await) \
	: delta(disk.dev.write_rawactive) / delta(disk.dev.write)) \
    : novalue(meta=disk.dev.await)
disk.dev.w_await(oneline) = average time write requests queued and serviced
disk.dev.w_await(helptext) = '\
average time in milliseconds that write requests were queued
(and serviced) during the reporting interval.'

disk.dev.d_await = defined(disk.dev.discard_rawactive) && defined(disk.dev.discard) ? \
    (delta(disk.dev.discard) == 0 ? \
	mkconst(0, meta=disk.dev.await) \
	: delta(disk.dev.discard_rawactive) / delta(disk.dev.discard)) \
    : novalue(meta=disk.dev.await)
disk.dev.d_await(oneline) = average time discard requests queued and serviced
disk.dev.d_await(helptext) = '\
average time in milliseconds that discard requests were queued
(and serviced) during the reporting interval.'

disk.dev.f_await = defined(disk.dev.flush_rawactive) && defined(disk.dev.flush) ? \
    (delta(disk.dev.flush) == 0 ? \
	mkconst(0, meta=disk.dev.await) \
	: delta(disk.dev.flush_rawactive) / delta(disk.dev.flush)) \
    : novalue(meta=disk.dev.await)
disk.dev.f_await(oneline) = average time flush requests queued and serviced
disk.dev.f_await(helptext) = '\
average time in milliseconds that flush requests were queued
(and serviced) during the reporting interval.'

disk.dev.avg_qlen = defined(disk.dev.read_rawactive) && defined(disk.dev.write_rawactive) ? \
    (rate(disk.dev.read_rawactive) + rate(disk.dev.write_rawactive)) \
    : novalue(meta=disk.dev.read, type=double, semantics=instant, units="")
disk.dev.avg_qlen(oneline) = average read and write queue length
disk.dev.avg_qlen(helptext) = '\
average read and write I/O queue length to the device during the reporting interval.'

disk.dev.avg_rqsz = (delta(disk.dev.read) + delt