groff-template/graphs.ms

86 lines
1.7 KiB
Plaintext

.NH
Graphs for DODB.
.LP
.PS
reset
.PE
.G1
label left "Request duration (ns)" "(Median and" "fifth percentiles)"
label bot "Number of cars"
# minx = 1e12; maxx = -1e12
n = sigx = sigx2 = sigy = sigxy = 0
obram = obuncache = obcache = obsemi = 0
cbram = cbuncache = cbcache = cbsemi = 0
coord y -5,100000
copy "data/index.d" thru X
# ram cached semi uncached
line from $1*5,$2 to $1*5,$4
line from $1*5,$5 to $1*5,$7
line from $1*5,$8 to $1*5,$10
line from $1*5,$11 to $1*5,$12
#ty = $3
cbram = $3
cbcache = $6
cbsemi = $9
cbuncache = $11
#if obram > 0 then line from $1*5, else
obram = cbram
obcache = cbcache
obsemi = cbsemi
obuncache = cbuncache
ox = cx
# ram cached semi uncached
.gcolor red
bullet at $1*5,$3
.gcolor
bullet at $1*5,$6
.gcolor blue
bullet at $1*5,$11
.gcolor
.gcolor green
bullet at $1*5,$13
.gcolor
#n = n+1
#sigx = sigx+$1; sigx2 = sigx2+$1*$1
#sigy = sigy+ty; sigxy = sigxy+$1*ty
#minx = min(minx,$1); maxx = max(maxx,$1)
X
## Calculate least squares fit and draw it
#slope = (n*sigxy - sigx*sigy) / (n*sigx2 - sigx*sigx)
#inter = (sigy - slope*sigx) / n
## print slope; print inter
#line from minx,slope*minx+inter to maxx,slope*maxx+inter
.G2
.\" .G1
.\" GROWTHFACTOR=0.07
.\" grid bot dotted from 0 to 100 by 10
.\" grid left dotted from 0 to 800 by 50
.\" frame ht 2.5 wid 2.8
.\" define expo { $1+$1*GROWTHFACTOR }
.\" value = 1
.\" draw LINEAR solid
.\" for i from 1 to 100 by 1 do {
.\" next LINEAR at i, i
.\" times at i, value
.\" value = expo(value)
.\" }
.\" line from 0,650 to 3,650
.\" " linear curve" ljust at 1,650
.\" " exponential curve" ljust at 1,600
.\" times at 1,600
.\" label top "Exponential curves: growth over time (7%)" up -.2
.\" .G2