From 7428ba757c44931d1076c403c1f83c943cd92382 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sun, 12 May 2024 20:47:09 +0200 Subject: [PATCH] Graphs: starting to look good. --- graphs/Makefile.in | 3 +- graphs/graphs.ms | 106 +++++++++++++++------------------------------ graphs/legend.grap | 47 ++++++++++++++++++++ 3 files changed, 84 insertions(+), 72 deletions(-) create mode 100644 graphs/legend.grap diff --git a/graphs/Makefile.in b/graphs/Makefile.in index 559d2be..8d23982 100644 --- a/graphs/Makefile.in +++ b/graphs/Makefile.in @@ -74,4 +74,5 @@ $(SRC).pdf: # Keep options in memory for the recursive 'make' call export SOELIM_OPTS PRECONV_OPTS EQN_OPTS GHIGHLIGHT_OPTS GRAP_OPTS PIC_OPTS REFER_OPTS serve: - find . -name "*.ms" -or -name "*.d" | entr gmake -B $(SRC).pdf + @#find . -name "*.ms" -or -name "*.d" | entr gmake -B $(SRC).pdf + find . | entr gmake -B $(SRC).pdf diff --git a/graphs/graphs.ms b/graphs/graphs.ms index f40673d..3c212d4 100644 --- a/graphs/graphs.ms +++ b/graphs/graphs.ms @@ -3,19 +3,25 @@ Indexes .LP .G1 +copy "legend.grap" frame invis ht 3 wid 4 left solid bot solid coord y 0,50 ticks left out from 0 to 50 by 10 +ticks bot out at 50000 "50,000", 100000 "100,000", 150000 "150,000", 200000 "200,000", 250000 "250,000" -label left "Request duration with" unaligned "an index (us)" "(Median)" left 1 -label bot "Number of cars in the database" - -# minx = 1e12; maxx = -1e12 -n = sigx = sigx2 = sigy = sigxy = 0 +label left "Request duration with" unaligned "an index (us)" "(Median)" left 0.8 +label bot "Number of cars in the database" down 0.1 obram = obuncache = obcache = obsemi = 0 # old bullets cbram = cbuncache = cbcache = cbsemi = 0 # current bullets +legendxleft = 100000 +legendxright = 250000 +legendyup = 15 +legendydown = 2 + +boite(legendxleft,legendxright,legendyup,legendydown) +legend(legendxleft,legendxright,legendyup,legendydown) copy "../data/index.d" thru X cx = $1*5 @@ -63,37 +69,32 @@ copy "../data/index.d" thru X .gcolor green bullet at cx,cbuncache .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 .NH Partitions .LP .G1 +copy "legend.grap" frame invis ht 3 wid 4 left solid bot solid coord x 0,5000*2 y 0,350 ticks left out from 0 to 350 by 50 -label left "Request duration for a partition (ms)" unaligned "(Median)" left 1.2 -label bot "Number of cars matching the partition" - -# minx = 1e12; maxx = -1e12 -n = sigx = sigx2 = sigy = sigxy = 0 +label left "Request duration" unaligned "for a partition (ms)" "(Median)" left 0.8 +label bot "Number of cars matching the partition" down 0.1 obram = obuncache = obcache = obsemi = 0 cbram = cbuncache = cbcache = cbsemi = 0 +legendxleft = 1000 +legendxright = 6500 +legendyup = 330 +legendydown = 230 + +boite(legendxleft,legendxright,legendyup,legendydown) +legend(legendxleft,legendxright,legendyup,legendydown) + copy "../data/partitions.d" thru X cx = $1*2 @@ -138,37 +139,31 @@ copy "../data/partitions.d" thru X .gcolor green bullet at cx,cbuncache .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 .bp .NH Tags .LP .G1 -label left "Request duration for a tag (ms)" unaligned "(Median)" left 1.2 -label bot "Number of cars matching the tag" - -# minx = 1e12; maxx = -1e12 -n = sigx = sigx2 = sigy = sigxy = 0 +copy "legend.grap" +frame invis ht 3 wid 4 left solid bot solid +coord x 0,5000 y 0,170 +ticks left out from 0 to 170 by 20 +label left "Request duration" unaligned "for a tag (ms)" "(Median)" left 0.8 +label bot "Number of cars matching the tag" down 0.1 obram = obuncache = obcache = obsemi = 0 cbram = cbuncache = cbcache = cbsemi = 0 -coord x 0,5000 y 0,170 -ticks left out from 0 to 170 by 20 +legendxleft = 200 +legendxright = 3000 +legendyup = 170 +legendydown = 120 + +boite(legendxleft,legendxright,legendyup,legendydown) +legend(legendxleft,legendxright,legendyup,legendydown) -frame invis ht 2 wid 4 left solid bot solid copy "../data/tags.d" thru X cx = $1 @@ -213,36 +208,5 @@ copy "../data/tags.d" thru X .gcolor green bullet at cx,cbuncache .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 diff --git a/graphs/legend.grap b/graphs/legend.grap new file mode 100644 index 0000000..5181cb6 --- /dev/null +++ b/graphs/legend.grap @@ -0,0 +1,47 @@ +define boite { + xleft = $1 + xright = $2 + yup = $3 + ydown = $4 + + line from xleft,ydown to xright,ydown + line from xleft,yup to xright,yup + line from xleft,yup to xleft,ydown + line from xright,yup to xright,ydown +} + +define legend { + xleft = $1 + xright = $2 + yup = $3 + ydown = $4 + + diffx = xright - xleft + diffy = yup - ydown + + hdiff = diffy/4.3 + cy = yup - (diffy/8) + cx = (diffx/20) + xleft + + lstartx = cx + lendx = cx + diffx/8 + tstartx = lendx + diffx/20 + + .gcolor red + line from lstartx,cy to lendx,cy + .gcolor + "RAM only" ljust at tstartx,cy + cy = cy - hdiff + line from lstartx,cy to lendx,cy + "Cached DODB" ljust at tstartx,cy + cy = cy - hdiff + .gcolor blue + line from lstartx,cy to lendx,cy + .gcolor + "Uncached db, cached index" ljust at tstartx,cy + cy = cy - hdiff + .gcolor green + line from lstartx,cy to lendx,cy + .gcolor + "Uncached db and index" ljust at tstartx,cy +}