Skip to content

Instantly share code, notes, and snippets.

@shelling
Created November 17, 2011 07:38
Show Gist options
  • Select an option

  • Save shelling/1372610 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/1372610 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "rubygems"
require "rrd"
file = "rrd/10.31.22.55_queue_com.trendmicro.spn.fbs20.HouseCall_001.03.rrd"
RRD::Wrapper.graph("temp.png",
"DEF:Pending=#{file}:NumMsgs82ff1e7ab6ff:LAST",
"DEF:Enqueue=#{file}:NumMsgsInd604c03a7d:LAST",
"DEF:Dequeue=#{file}:NumMsgsOut352e0a04c:LAST",
"DEF:Dropped=#{file}:NumMsgs4c353d7d1b5b:LAST",
"LINE1:Pending#ff0000:Pending",
"LINE2:Enqueue#00ff00:Enqueue",
"LINE3:Dequeue#0000ff:Dequeue",
"LINE4:Dropped#ffff00:Dropped")
#!/bin/bash
start=$(($(date +%s)-140000))
file=$1
echo $file
rrdtool graph temp1.png --start $start \
DEF:pending=$file:NumMsgs82ff1e7ab6ff:LAST \
DEF:enqueue=$file:NumMsgsInd604c03a7d:LAST \
DEF:dequeue=$file:NumMsgsOut352e0a04c:LAST \
DEF:dropped=$file:NumMsgs4c353d7d1b5b:LAST \
LINE1:pending#ff0000:Pending \
LINE2:enqueue#00ff00:Enqueue \
LINE3:dequeue#0000ff:Dequeue \
LINE4:dropped#ffff00:Dropped
rrdtool graph temp2.png --start $start \
DEF:pendingsize=$file:NumMsgs82ff1e7ab6ff:LAST \
DEF:enqueuesize=$file:MsgBytesInc06976042:LAST \
DEF:dequeuesize=$file:TotalMsgBytes4c10d0:LAST \
LINE1:pendingsize#ff0000:PendingSize \
LINE2:enqueuesize#00ff00:EnqueueSize \
LINE3:dequeuesize#0000ff:DequeueSize
rrdtool graph temp3.png --start $start \
DEF:producer=$file:NumProducers327fcd6:LAST \
DEF:consumer=$file:NumConsumers1bbb666:LAST \
LINE1:producer#ff0000:PendingSize \
LINE2:consumer#00ff00:EnqueueSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment