[pulseaudio-discuss] [PATCH 2/2] scripts: Plot memory usage data using Gnuplot

Ahmed S. Darwish darwish.07 at gmail.com
Sat Aug 29 03:45:58 PDT 2015


Now that we have memory usage benchmarks collected at our disposal
under `scripts/benchmarks', introduce a Gnuplot script to plot the
newest version of these benchmarks.

To avoid scaling issues, memory is plotted in a "double y axis" form,
with VM usage on the left, and dirty RSS memory usage on the right.

Signed-off-by: Ahmed S. Darwish <darwish.07 at gmail.com>
---
 scripts/plot_memory_usage.gp | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 scripts/plot_memory_usage.gp

diff --git a/scripts/plot_memory_usage.gp b/scripts/plot_memory_usage.gp
new file mode 100644
index 0000000..7cfff0e
--- /dev/null
+++ b/scripts/plot_memory_usage.gp
@@ -0,0 +1,37 @@
+#
+# PulseAudio memory usage plot
+#
+# Run this using:
+#       `gnuplot plot_memory_usage.gp`
+#
+
+# Print our user messages to the stdout
+set print "-"
+
+inputFile = "benchmarks/MEMORY-USAGE-LATEST.txt"
+outputFile = "pulse-memory-usage.png"
+
+set title "PulseAudio Memory Usage Over Time"
+set xlabel "Number of councurrent 'paplay' clients"
+
+set ylabel "Virtual memory consumption (GiB)"
+set y2label "Dirty RSS consumption (MiB)"
+set ytics nomirror
+set y2tics
+
+# Finer granulrity for x-axis ticks ...
+set xtics 1,1
+set grid
+
+# Use CAIRO's PNG backend. This produces images which are way
+# better-rendered than the barebone classical png backend.
+set terminal pngcairo enhanced size 1000,768 font 'Verdana,10'
+set output outputFile
+
+print "Plotting data from input file: ", inputFile
+print "..."
+
+plot inputFile using 1:($2/1024/1024) title "VmSize" axes x1y1 with linespoints, \
+     inputFile using 1:($3/1024) title "Dirty RSS" axes x1y2 with linespoints
+
+print "Done! Check our performance at: ", outputFile

-- 
Darwish
http://darwish.chasingpointers.com


More information about the pulseaudio-discuss mailing list