1 2# This file is part of PulseAudio. 3# 4# Copyright 2015 Ahmed S. Darwish <darwish.07@gmail.com> 5# 6# PulseAudio is free software; you can redistribute it and/or modify 7# it under the terms of the GNU Lesser General Public License as published by 8# the Free Software Foundation; either version 2 of the License, or 9# (at your option) any later version. 10# 11# PulseAudio is distributed in the hope that it will be useful, but 12# WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14# General Public License for more details. 15# 16# You should have received a copy of the GNU Lesser General Public License 17# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 18 19# 20# PulseAudio memory usage plotting script 21# 22# Before invocation, generate necessary data by running the 23# 'benchmark_memory_usage.sh' bash script. Afterwards, you can plot 24# such data by running: 25# 26# gnuplot plot_memory_usage.gp 27# 28# Note! To avoid scaling issues, memory is plotted in a "double y axis" 29# form, with VM usage on the left, and dirty RSS memory usage on the 30# right. The scales are different. 31# 32 33# Print our user messages to the stdout 34set print "-" 35 36benchDir = system('dirname ' .ARG0) .'/benchmarks/' 37inputFile = benchDir ."memory-usage-LATEST.txt" 38outputFile = benchDir ."pulse-memory-usage.png" 39 40set title "PulseAudio Memory Usage Over Time" 41set xlabel "Number of councurrent 'paplay' clients" 42 43set ylabel "Virtual memory consumption (GiB)" 44set y2label "Dirty RSS consumption (MiB)" 45set ytics nomirror 46set y2tics 47 48# Finer granulrity for x-axis ticks ... 49set xtics 1,1 50set grid 51 52# Use Cairo's PNG backend. This produce images which are way 53# better-rendered than the barebone classical png backend 54set terminal pngcairo enhanced size 1000,768 font 'Verdana,10' 55set output outputFile 56 57print "Plotting data from input file: ", inputFile 58print "..." 59 60plot inputFile using 1:($2/1024/1024) title "VmSize" axes x1y1 with linespoints, \ 61 inputFile using 1:($3/1024) title "Dirty RSS" axes x1y2 with linespoints 62 63print "Done! Check our performance at: ", outputFile 64