dkogan/feedgnuplot

Pruning old data with histograms

Closed this issue · 7 comments

Hi,
I'm plotting the ping rtt with a command similar to this:
sudo ping -A 172.15.0.3 -D | gawk '$4=="from" && $8~/time=/ && $9=="ms" {gsub(/[\[#\]]/, "", $1); gsub("time=", "", $8); print $1, $8; fflush()}' | feedgnuplot --domain --stream --lines --histogram 0 --binwidth 0.001 --histstyle freq--style 0 "linewidth 2"

This works as expected, but it clogs down at some point because it's keeping all old data.
If I add "--xlen 10", gnuplot complains:

gnuplot> plot '-' using (histbin($2)):(1.0) smooth freq notitle linewidth 2
^
line 30480: all points y value undefined!

Am I misunderstanding the functionality? Is this a bug?

Thanks,
Vladimir

Yes, this is all I'm trying to achieve.

Ok thanks for the answer. For the moment I may work around the issue by using an external program to generate the histograms.

I made a few updates and this should now work with the sources in master. Look at the example in the manpage.

Thanks for taking the time to implement this.
If I had to nitpick, I'd say that for histograms, --xmin and --xmax have a usefulness of their own, so they shouldn't be mutually exclusive with --xlen. For example, I'd like to be able to trim the histogram to only show rtt times between 0-20ms, and group all the out-of-range values in the first/last bin.

You're not nitpicking at all. Thanks for the comment; I've pushed a fix. This is a set of features that I haven't been using together so there's untested logic, and I'm glad people are pointing out the deficiencies.