Skip to content
Snippets Groups Projects
Commit 60ad9f89 authored by Zach Brown's avatar Zach Brown
Browse files

- derive graph colors from rpc names. this gets hard to look at with

  many rpcs, but at least it works.
- also raise the graph a bit to account for lots more types of rpcs.
  need to get rid of a lot of the whitespace between bars..
parent fcff107c
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,18 @@ cleanup() { ...@@ -18,6 +18,18 @@ cleanup() {
} }
trap cleanup EXIT trap cleanup EXIT
hex2float() {
echo "ibase=16;scale=2;$*/FF" | bc
}
make_color() {
local md5=`echo "$*" | md5sum - | awk '{print $1}' | \
tr '[a-z]' '[A-Z]'`;
local r=`echo $md5 | cut -b 1,2`
local g=`echo $md5 | cut -b 3,4`
local b=`echo $md5 | cut -b 5,6`
echo "rgb(`hex2float $r`,`hex2float $g`,`hex2float $b`)"
}
rpc_name() { rpc_name() {
case "$1" in case "$1" in
0) echo "OST_REPLY" ;; 0) echo "OST_REPLY" ;;
...@@ -233,12 +245,6 @@ sort -n $tmpdir/data >> $pl_script || die "sorting failed" ...@@ -233,12 +245,6 @@ sort -n $tmpdir/data >> $pl_script || die "sorting failed"
# jeez. without another newline at the end pl doesn't read the last data row. # jeez. without another newline at the end pl doesn't read the last data row.
echo >> $pl_script echo >> $pl_script
# could be smarter here
# http://ploticus.sourceforge.net/doc/color.html
colors=("red" "orange" "green" "blue" "purple" "pink" "powderblue" "yellow" \
"brown")
num_colors=9
legend_index=0 legend_index=0
legend_pane=0 legend_pane=0
ops_per_pane=$(((NUM_OP_CODES + 2)/ 3)) ops_per_pane=$(((NUM_OP_CODES + 2)/ 3))
...@@ -248,8 +254,6 @@ for op in $OP_CODES; do ...@@ -248,8 +254,6 @@ for op in $OP_CODES; do
name=`rpc_name $op` name=`rpc_name $op`
[ $name == "unknown" ] && die "unknown op code $op" [ $name == "unknown" ] && die "unknown op code $op"
[ $i == $num_colors ] && die "ran out of colors"
label="$name "`pct ${rpc_count[$op]} $TOTAL_RPCS` label="$name "`pct ${rpc_count[$op]} $TOTAL_RPCS`
label="$label, "`pct ${rpc_total_time[$op]} $TOTAL_RPC_TIME` label="$label, "`pct ${rpc_total_time[$op]} $TOTAL_RPC_TIME`
...@@ -260,7 +264,7 @@ for op in $OP_CODES; do ...@@ -260,7 +264,7 @@ for op in $OP_CODES; do
to_pl "#proc legendentry to_pl "#proc legendentry
sampletype: color sampletype: color
label: $label label: $label
details: ${colors[$i]} details: `make_color $name`
tag: $op" tag: $op"
# ploticus makes you construct seperage legends stacked next to each # ploticus makes you construct seperage legends stacked next to each
...@@ -303,7 +307,7 @@ done ...@@ -303,7 +307,7 @@ done
to_pl " to_pl "
#proc areadef #proc areadef
rectangle: 1 1 9.5 8 rectangle: 1 2 9.5 8
xautorange datafields=2,3 xautorange datafields=2,3
xrange: $MIN $MAX xrange: $MIN $MAX
yscaletype: categories yscaletype: categories
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment