# derived metrics for processes

# metrics to provide additional process details
proc.psinfo.age = kernel.all.uptime - proc.psinfo.start_time
proc.io.total_bytes = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)

# metrics to identify resource hogs
proc.hog.cpu = 100 * (rate(proc.psinfo.utime) + rate(proc.psinfo.stime)) / (kernel.all.uptime - proc.psinfo.start_time)
proc.hog.mem = proc.memory.vmrss + proc.memory.vmswap
proc.hog.disk = (rate(proc.io.read_bytes) + rate(proc.io.write_bytes) - rate(proc.io.cancelled_write_bytes)) / (kernel.all.uptime - proc.psinfo.start_time)
