Bug#984917: feedgnuplot: dynamic plots (--stream) do not work
Dima Kogan
dima at secretsauce.net
Wed Mar 10 22:15:43 GMT 2021
Hi. Notes inline.
Detlev Zundel <dzu at member.fsf.org> writes:
> I cannot get dynamic plots to work on my system.
OK. I suspect this is something on your end, but let's run some
experiments.
> while true; do sleep 1; cat /proc/net/dev; done |
> gawk '/enp6s0/ {if(b) {print $2-b; fflush()} b=$2}' |
> feedgnuplot --lines --stream --xlen 10 --ylabel 'Bytes/sec' --xlabel seconds
>
> This opens up a gnuplot window but it is not updating every second as
> it should. The lower left corner seems to be showing a coordinate and
> this indeed updates every second, but the plot itself does not. From
> time to time the plot gets redrawn but then again stays fixed.
I can think of several potential causes. First off, let's eliminate X
issues. Can you please add '--terminal "dumb 80 40"' to the feedgnuplot
command? If that works properly, you'll see an ascii plot printed onto
your console every second. Do you see that?
> Doing more diagnosing, I used the --dump switch to see what is being fed into
> gnuplot and when I manually run gnuplot and paste the fragments into it, it
> works just fine. It seems to be related with the fact that gnuplot reads the
> input from the pipe.
Right. The second theory is that it's something related to buffering.
That command should handle it, but let's see. Try this:
1. apt install mawk
2. while true; do sleep 1; cat /proc/net/dev; done |
mawk -Winteractive '/enp6s0/ {if(b) {print $2-b} b=$2}' |
feedgnuplot --lines --stream --xlen 10 --ylabel 'Bytes/sec' --xlabel seconds --terminal 'dumb 80 40'
So use "mawk -Winteractive" instead of "gawk", and remove the fflush().
Does that make any difference?
> Maybe this is related to the gnuplot version in Bullseye?
Maybe, but I doubt it. Please run the two experiments above, and we can
go from there.
More information about the debian-science-maintainers
mailing list