fetchpull-plot.gnuplot 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. set xdata time
  2. set datafile separator ";"
  3. set timefmt "%Y-%m-%d"
  4. set format x "%Y-%m-%d"
  5. # logarithmic seconds to show both realtime and bulk together
  6. set logscale y
  7. # styling
  8. set xtics rotate by 45 right
  9. set xlabel "retrieval date"
  10. set ylabel "time to retrieve (seconds)"
  11. set cbtics format ""
  12. set cbtics add ("0" 0)
  13. set cbtics add ("1" 1)
  14. set cbtics add ("2" 2)
  15. set cbtics add ("4" 3)
  16. set cbtics add ("8" 4)
  17. set cbtics add ("16" 5)
  18. set cbtics add ("32" 6)
  19. set cbtics add ("64" 7)
  20. set cbtics add ("128" 8)
  21. set cbtics add ("256" 9)
  22. set cbtics add ("512" 10)
  23. set cblabel "age / days since upload"
  24. # add jitter for a bee swarm plot to get a better understanding of the data density without needing transparency
  25. # overlap is vertical binning, spread is horizontal jitter, wrap limits horizontal spread
  26. set jitter overlap 7 spread 0.02 wrap 1
  27. # moving average, see https://gnuplot.sourceforge.net/demo/running_avg.html and https://stackoverflow.com/a/55935923/7666
  28. # number of points in average
  29. n = 64
  30. array A[n]
  31. samples(x) = $0 > (n - 1) ? n : int($0+1)
  32. mod(x) = int(x) % n
  33. avg_n(x) = (A[mod($0)+1]=x, (sum [i=1:samples($0)] A[i]) / samples($0))
  34. # plot requests
  35. set title "fetchpull: requests"
  36. set term png size 800,600
  37. set output "fetchpull-get-realtime.png"
  38. plot "<(grep realtime\\;\\#t fetchpull-stats-get.csv)" using 1:3:(log((column(4)+1))/log(2)) palette lw 1 title "realtime succeeded", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 300 title "5 min" at end lw 2 lc "#cccccc", \
  39. "<(grep \\;1\\;realtime\\;\\#t fetchpull-stats-get.csv)" using 1:(avg_n($3)) title "running mean over previous 64 age 1 points" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  40. replot
  41. set output "fetchpull-get-small.png"
  42. plot "<(grep small\\;\\#t fetchpull-stats-get.csv)" using 1:3:(log((column(4)+1))/log(2)) palette lw 1 title "small succeeded", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 600 title "10 min" at end lw 2 lc "#cccccc", \
  43. "<(grep \\;1\\;small\\;\\#t fetchpull-stats-get.csv)" using 1:(avg_n($3)) title "running mean over previous 64 age 1 points" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  44. replot
  45. set output "fetchpull-get-bulk.png"
  46. plot "<(grep \\;bulk\\;\\#t fetchpull-stats-get.csv)" using 1:3:(log((column(4)+1))/log(2)) palette lw 1 title "bulk succeeded", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 600 title "10 min" at end lw 2 lc "#cccccc", 3600 title "60 min" at end lw 2 lc "#dddddd", \
  47. "<(grep \\;1\\;bulk\\;\\#t fetchpull-stats-get.csv)" using 1:(avg_n($3)) title "running mean over previous 64 age 1 points" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  48. replot
  49. # failed requests get less jitter
  50. set jitter overlap 0.5 spread 0.1 wrap 1
  51. set title "fetchpull: failed requests"
  52. set term png size 800,600
  53. set output "fetchpull-get-failed-realtime.png"
  54. plot "<(grep realtime\\;\\#f fetchpull-stats-get.csv)" using 1:(column(3)<20000? column(3) : 1/0):(log((column(4)+1))/log(2)) palette lw 1 pt 4 title "realtime failed", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 300 title "5 min" at end lw 2 lc "#cccccc", \
  55. "<(grep \\;1\\;realtime\\;\\#f fetchpull-stats-get.csv)" using 1:(avg_n($3)) title "running mean over previous 64 age 1 points" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  56. replot
  57. set output "fetchpull-get-failed-small.png"
  58. plot "<(grep small\\;\\#f fetchpull-stats-get.csv)" using 1:(column(3)<20000? column(3) : 1/0):(log((column(4)+1))/log(2)) palette lw 1 title "small failed", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 600 title "10 min" at end lw 2 lc "#cccccc", \
  59. "<(grep \\;1\\;small\\;\\#f fetchpull-stats-get.csv)" using 1:(avg_n($3)) title "running mean over previous 64 age 1 points" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  60. replot
  61. set output "fetchpull-get-failed-bulk.png"
  62. plot "<(grep bulk\\;\\#f fetchpull-stats-get.csv)" using 1:(column(3)<20000? column(3) : 1/0):(log((column(4)+1))/log(2)) palette lw 1 title "bulk failed", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 600 title "10 min" at end lw 2 lc "#cccccc", \
  63. "<(grep \\;1\\;bulk\\;\\#f fetchpull-stats-get.csv)" using 1:(avg_n($3)) title "running mean over previous 64 age 1 points" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  64. replot
  65. # plot inserts
  66. set output "fetchpull-put.png"
  67. set title "fetchpull: inserts"
  68. set ylabel "time to upload (seconds)"
  69. set xlabel "upload date"
  70. set cblabel "days until download"
  71. plot "<(grep realtime\\;\\#t fetchpull-stats-put.csv)" using 1:3:(log((column(4)+1))/log(2)) palette lw 1 title "realtime succeeded", "<(grep small\\;\\#t fetchpull-stats-put.csv)" using 1:3:(log((column(4)+1))/log(2)) palette lw 1 title "small succeeded", "<(grep bulk\\;\\#t fetchpull-stats-put.csv)" using 1:3:(log((column(4)+1))/log(2)) palette lw 1 title "bulk succeeded", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 600 title "10 min" at end lw 2 lc "#cccccc", 3600 title "60 min" at end lw 2 lc "#dddddd", \
  72. "<(grep \\;1\\;realtime\\;\\#t fetchpull-stats-put.csv)" using 1:(avg_n($3)) title "running means, last 64, in 1 day" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan", \
  73. "<(grep \\;1\\;small\\;\\#t fetchpull-stats-put.csv)" using 1:(avg_n($3)) title "" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan", \
  74. "<(grep \\;1\\;bulk\\;\\#t fetchpull-stats-put.csv)" using 1:(avg_n($3)) title "" pt 7 ps 0.5 lw 2 lc rgb "dark-cyan"
  75. replot
  76. # plot inserts
  77. set output "fetchpull-put-failed.png"
  78. set title "fetchpull: failed inserts"
  79. set ylabel "time to upload (seconds)"
  80. set xlabel "upload date"
  81. set cblabel "days until download"
  82. plot "<(grep realtime\\;\\#f fetchpull-stats-put.csv)" using 1:(column(3)<20000? column(3) : 1/0):(log((column(4)+1))/log(2)) palette lw 1 pt 4 title "realtime failed", "<(grep small\\;\\#f fetchpull-stats-put.csv)" using 1:(column(3)<20000? column(3) : 1/0):(log((column(4)+1))/log(2)) palette lw 1 title "small failed", "<(grep bulk\\;\\#f fetchpull-stats-put.csv)" using 1:(column(3)<20000? column(3) : 1/0):(log((column(4)+1))/log(2)) palette lw 1 title "bulk failed", 3 title " 3 s" at end lw 2 lc "#cccccc", 10 title "10 s" at end lw 2 lc "#aaaaaa", 60 title "1 min" at end lw 2 lc "#aaaaaa", 600 title "10 min" at end lw 2 lc "#cccccc", 3600 title "60 min" at end lw 2 lc "#dddddd"
  83. replot
  84. # plot max age of requests
  85. unset cbtics
  86. set yrange [1:1000]
  87. set logscale y
  88. set logscale cb
  89. set cbtics format ""
  90. set cbtics add ("0" 0)
  91. set cbtics add ("1" 1)
  92. set cbtics add ("2" 2)
  93. set cbtics add ("4" 4)
  94. set cbtics add ("8" 8)
  95. set cbtics add ("16" 16)
  96. set cbtics add ("32" 32)
  97. set cbtics add ("64" 64)
  98. set cbtics add ("128" 128)
  99. set cbtics add ("256" 256)
  100. set cbtics add ("512" 512)
  101. set cbtics add ("1024" 1024)
  102. set cbtics add ("2048" 2048)
  103. set cbtics add ("4096" 4096)
  104. set ylabel "age / days since upload"
  105. set cblabel "time to download (s)"
  106. set title "fetchpull: lifetime download-time"
  107. set term png size 800,600
  108. set output "fetchpull-lifetime-realtime.png"
  109. plot "<(grep realtime\\;\\#t fetchpull-stats-get.csv)" using 1:4:3 palette lw 1 title "realtime succeeded"
  110. set output "fetchpull-lifetime-small.png"
  111. plot "<(grep small\\;\\#t fetchpull-stats-get.csv)" using 1:4:3 palette lw 1 title "small succeeded"
  112. set output "fetchpull-lifetime-bulk.png"
  113. plot "<(grep bulk\\;\\#t fetchpull-stats-get.csv)" using 1:4:3 palette lw 1 title "bulk succeeded"
  114. # download time heatmaps (do not work well yet)
  115. # set view map
  116. # set dgrid3d
  117. # set pm3d interpolate 16,16
  118. # set title "fetchpull: average download time"
  119. #
  120. # set output "fetchpull-lifetime-bulk-download-time.png"
  121. # splot "<(grep 'bulk;#t' fetchpull-stats-get.csv)" using 1:4:3 palette with pm3d title "bulk succeeded"
  122. # set output "fetchpull-lifetime-small-download-time.png"
  123. # splot "<(grep 'small;#t' fetchpull-stats-get.csv)" using 1:4:3 palette with pm3d title "bulk succeeded"
  124. # success count plots
  125. set title "fetchpull: lifetime: monthly success-count"
  126. unset datafile separator
  127. unset logscale cb
  128. unset cbtics
  129. set cbtics format "%g "
  130. set cblabel "successful downloads (count)"
  131. # simple monthly binning
  132. set timefmt "%Y-%m"
  133. set format x "%Y-%m"
  134. set output "fetchpull-lifetime-realtime-success-count.png"
  135. plot "<(grep 'realtime;#t' fetchpull-stats-get.csv | sed 's/-..;/;/;s/;[^;]+//;s/;[^;]*//;s/;[^;]*//;s/;/ /g' | sort | uniq -c)" using 2:3:1 palette lw 4 title "realtime succeeded", 14 title "2 weeks" at begin lw 2 lc "#aaaaaa", 90 title "3 mo." at begin lw 2 lc "#cccccc"
  136. set output "fetchpull-lifetime-small-success-count.png"
  137. plot "<(grep 'small;#t' fetchpull-stats-get.csv | sed 's/-..;/;/;s/;[^;]+//;s/;[^;]*//;s/;[^;]*//;s/;/ /g' | sort | uniq -c)" using 2:3:1 palette lw 4 title "small succeeded", 14 title "2 weeks" at begin lw 2 lc "#aaaaaa", 90 title "3 mo." at begin lw 2 lc "#cccccc"
  138. set output "fetchpull-lifetime-bulk-success-count.png"
  139. plot "<(grep 'bulk;#t' fetchpull-stats-get.csv | sed 's/-..;/;/;s/;[^;]+//;s/;[^;]*//;s/;[^;]*//;s/;/ /g' | sort | uniq -c)" using 2:3:1 palette lw 4 title "bulk succeeded", 14 title "2 weeks" at begin lw 2 lc "#aaaaaa", 90 title "3 mo." at begin lw 2 lc "#cccccc"
  140. replot
  141. quit