Skip to content

Instantly share code, notes, and snippets.

@rashkur
Forked from Snawoot/gist:c54a4ee76d7a18294369
Last active August 29, 2015 14:07
Show Gist options
  • Save rashkur/ca64556347277e0dee7f to your computer and use it in GitHub Desktop.
Save rashkur/ca64556347277e0dee7f to your computer and use it in GitHub Desktop.
$def[1] .= "".
# incoming
"DEF:inbytes=$RRDFILE[1]:$DS[1]:MAX ".
"CDEF:intraffic=inbytes,$unit_multiplier,* ".
"CDEF:inmb=intraffic,1048576,/ ".
"VDEF:consumed=intraffic,TOTAL ".
"AREA:inmb#00e060:\"in \" ".
"GPRINT:intraffic:LAST:\"%7.1lf %s$unit/s last\" ".
"GPRINT:intraffic:AVERAGE:\"%7.1lf %s$unit/s avg\" ".
"GPRINT:intraffic:MAX:\"%7.1lf %s$unit/s max\\n\" ".
"GPRINT:consumed:\"%6.1lf %s$unit/s consumed\\n\" ".
"VDEF:inperc=intraffic,95,PERCENTNAN ".
"VDEF:inpercmb=inmb,95,PERCENTNAN ".
"LINE:inpercmb#008f00:\"95% percentile\" ".
"GPRINT:inperc:\"%7.1lf %s$unit/s\\n\" ".
# outgoing
"DEF:outbytes=$RRDFILE[6]:$DS[6]:MAX ".
"CDEF:outtraffic=outbytes,$unit_multiplier,* ".
"CDEF:minusouttraffic=outtraffic,-1,* ".
"CDEF:outmb=outtraffic,1048576,/ ".
"CDEF:minusoutmb=0,outmb,- ".
"VDEF:emitted=outtraffic,TOTAL ".
"AREA:minusoutmb#0080e0:\"out \" ".
"GPRINT:outtraffic:LAST:\"%7.1lf %s$unit/s last\" ".
"GPRINT:outtraffic:AVERAGE:\"%7.1lf %s$unit/s avg\" ".
"GPRINT:outtraffic:MAX:\"%7.1lf %s$unit/s max\\n\" ".
"GPRINT:emitted:\"%6.1lf %s$unit/s emitted\\n\" ".
"VDEF:outperc=minusouttraffic,5,PERCENTNAN ".
"VDEF:outpercmb=minusoutmb,5,PERCENTNAN ".
"LINE:outpercmb#00008f:\"95% percentile\" ".
"GPRINT:outperc:\"%7.1lf %s$unit/s\\n\" ".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment