Bug#984917: feedgnuplot: dynamic plots (--stream) do not work
Detlev Zundel
dzu at member.fsf.org
Thu Mar 11 20:15:23 GMT 2021
Hi Dima,
> Hi. Notes inline.
Thanks for your quick reply!
>> 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.
I am 100% sure it is something on my end. The question is if it is my
fault or reproducible on other machines as well ;)
>> 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?
Works like a charm.
>> 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?
Nope. Same behaviour. Position in lower left corner updates, graph
does not. Only one update after approximately 8 seconds then again
fixed.
>> 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.
I should have mentioned I only recently switched from GNOME on Xorg to
GNOME on Wayland. I hope it does not make a difference but I wanted to
mention it.
Any other ideas?
Thanks in advance!
Detlev
--
Any fool can write code that a computer can understand. Good
programmers write code that humans can understand.
-- Martin Fowler
More information about the debian-science-maintainers
mailing list