Closed eMPee584 closed 1 year ago
sounds simple enough, would you consider sending a PR?
but wait, this is already there:
https://github.com/tenox7/ttyplot/blob/master/ttyplot.c#L217
is it not working correctly?
Well checked again, it doesn't seem so.. using debian's version 1.4+77.g1a1693b-2
..
My slow moving graphs that update once an hour do not update on window resize:
netstat -b -w 3600 -I em0 | awk 'NR>3 { print $1/1048576; print $2/1048576; fflush }' | ttyplot -2 -t "IN/OUT Bandwidth in MB/s (${1}s resolution)" -u "MB/s" -c "#"
Using version 1.4 on OpenBSD.
thanks, let me investigate a bit more
netstat -b -w 3600 -I em0 | awk 'NR>3 { print $1/1048576; print $2/1048576; fflush }' | ttyplot -2 -t "IN/OUT Bandwidth in MB/s (${1}s resolution)" -u "MB/s" -c "#"
thats actually a really cool way of getting bandwidth usage! @zbits would you like to send a PR for readme/examples :)
OK I did some testing and I think I understand the issue. So redraw() is called on SIGWINCH, however it doesn't actually repaint the screen. The screen is eventually correctly redrawn when there is data for a new refresh, however in this case this would be after 1 hour. This should not be the case, SIGWINCH should do a full redraw of course.
The fix would be to repaint the screen with current data in a separate function. That function would be called either from the main while loop or refresh() on SIGWINCH.
ok I think I fixed it, in head master
can you download the source, compile and test?
That fixed it! Thank you.
Note that compiling it on openbsd the library "tinfo" was missing. I wasn't sure how to obtain it and the ttyplot git commits didn't explain its necessity, so I edited it out of the Makefile and ttyplot compiled and worked fine.
thats actually a really cool way of getting bandwidth usage! @zbits would you like to send a PR for readme/examples :)
I'm new to git and have never created a PR but I will read up on it and send you one.
Thanks for the ttyplot project. I love its simplicity. In my case, it replaced a prometheus/grafana solution.
thanks for testing! Let me know if any issues, I will make a release 1.5 with this soon
as for a PR, you basically fork it (top right "Fork"), then in your own copy you make edits - you can do it online even use the pen button just beside readme, make a commit, then once looks good then go to pull requests and create a PR
Otherwise, the plot will look broken until the regular refresh timeout has occurred..