Closed annacrombie closed 3 years ago
@AdrianDC @holmanb would you like to take a look at this before I merge it?
I've only read the description so far, but it sounds promising. I'll take a looks at the implementation and make comments if I have any.
This pr totally refactors the input system. It simplifies the actual reading of numbers and makes data processing more flexible.
Pipelines
With this pr, you specify a pipeline for each input. Currently, this is with the option '-p'.
example:
the equivalent of
seq 1 100 | plot -a 5
would becomeseq 1 100 | plot -p avg:5
or you could get a simple moving average with this:
furthermore, these data processors or data procs, can be composed
They can also be set per input. Using
-p
before any input sets the default pipeline which is copied to each input.data source original: https://datahub.io/core/natural-gas
The pipelines for the above look like
implemented data procs:
n
inputs together into a single data pointn
inputs(val - old_val) / t
Other changes
-a
has been deprecated, but still works as a shorthand for-p avg:n
-i data.txt:r
will add the flagrewind
to the pipeline for data.txtr
(rewind) andn
(nonblock)plot -f -i /sys/class/net/wlan0/statistics/rx_packets:r
and get a stream of numbersL
input files are opened in nonblocking mode so that -f behavior is more controllablethis is now an input flagTODO