SYNOPSIS[-dDSsvlmFgGhtAERIMNTLzfcpue ] [-display ] [-geometry ] [-iconic ] Aq Ar fifo | - Aq Ar hist-spec | hist-sz x-sz [low high ]
DESCRIPTIONis a general-purpose, efficient trend graph for "live" data. Data is read in ASCII form from a file or continuously from a FIFO and displayed in real-time into a multi-pass trend (much like a CRT oscilloscope). can be used as a rapid analysis tool for progressive or time-based data series together with trivial scripting.
requires at least a valid fifo to read from and an history specification ( hist-spec or, for advanced usage, a combination of history size and horizontal size ( hist-sz and x-sz respectively). Optionally, to disable auto-scaling, the vertical limits can be specified directly through the command line via low and high The default input format is ASCII, in absolute counting mode. Many settings can be changed directly during execution.
FIFOTo display real-time data you should use a FIFO. Both standard input and named pipes can be used. Standard input (used for simple pipelining purposes) can be opened by using - instead of a named file. A named FIFO can be created using the mkfifo(1) command. FIFOs are automatically re-opened upon EOF. See the Sx EXAMPLES section.
Alternatively you can store your data in a plain file and simply display its last values non-interactively.
When new data is written, the value is plotted and the cursor position is advanced. That is, the graph scrolling speed is determined by the speed of the data flow. When the number of received values is above the specified horizontal size, the graph will wrap or scroll, depending on your settings.
ASCII DATAThe default data format is a space/tab/newline-separated series of parseable ASCII numbers; eg:
1 2 3 4 5.1 0642 0x12 -12.4E5 .987
The parser is very lenient, and will silently ignore whatever looks like garbage.
COUNTING MODESBy default all input values are considered absolute and displayed "as is" in a single graph.
The -c [N]mode flag sets an alternate counting mode and the number of available graphs. Available modes are:
- absolute (default)
- incremental counter
- differential values
In incremental and differential mode, each value is calculated using the previous value as a reference except for the first, which is taken as absolute. The number of graphs can be specified by prefixing a multiplier before the counting mode (eg: 2a draws two graphs in absolute mode). See Sx MULTIPLE GRAPHS for more details on how this affects the input stream.
FORMAT TYPESDifferent input formats are supported, as specified by the -f flag. Note however that only the ASCII parser (the default) silently ignores errors. NaNs and Infinity have special treatment. Internally, always works with double precision floating points: conversion toward these is performed with the default FPU conversion rules. The actual underlying binary format depends on the host architecture:
- ASCII parser (default)
- binary float
- binary double
- binary short
- binary int
- binary long
SPECIAL VALUESASCII and binary floating point input have special treatment for NaNs and Infinity (entered in any representable form). Both are considered as "undefined values". Undefined values can be highlighted, but aren't otherwise rendered. If the -e flag is set, Infinity enters an escape sequence instead (See Sx ESCAPE SEQUENCES )
MULTIPLE GRAPHSMultiple graphs can be displayed inside a single trend instance by specifying a prefix number N for the -c flag. The input is interleaved, but otherwise unchanged: the reference value, if needed, is expected to be seen N times, one for each graph. Thus, for three graphs (A, B and C), the input order is:
[A0 B0 C0] A1 B1 C1 A2 B2 C2 .. .. ..
The display is updated only once all graph values are read. The color, label and origin for each graph can be specified through the usual command-line flags, separating each value with a comma; in the same order as the input. Default colors and labels are assigned if not completely specified.
All graphs share and are affected by the same settings, except for the origin (zero) which can be changed independently. Filling, values and the examiners only work on the current graph. The current graph can be cycled dynamically with the TAB key and differentiated using the K key, which cycles between "normal", "dim others" and "hide others" views. The graph key, if enabled, also highlights the current graph.
ESCAPE SEQUENCESIf escape sequences are enabled (through the -e flag), entering Infinity (in any representable form) will start an escape sequence. Currently, this feature is not yet implemented: Infinity is simply discarded. This is reserved for future use as a way to control the interface and parameters remotely.
- "dimmed" shading mode
- visible distribution graph
- enable anti-aliasing
- "scrolling" mode
- visible values
- visible visual/max sync latency
- visible marker
- enable filling
- visible grid
- -G grid-spec
- specify grid resolution
- -z zero[,zero...]
- specify y zero/s
- help and version info
- -t str
- specify a window title
- -A colour
- background colour
- -E colour
- text (values) colour
- -R colour
- grid colour
- -I colour[,colour...]
- trend colour/s
- -M colour
- marker colour
- -N colour
- interactive examiner colour
- -T colour
- edit mode colour
- -L label[,label...]
- trend label/s
- -c mode
- input number/counting mode (See Sx COUNTING MODES )
- -f format
- input format (See Sx FORMAT TYPES )
- -p rate
- polling rate (hz)
- show undefined values
- enable escape sequences (See Sx ESCAPE SEQUENCES )
- See X(7)
- See X(7)
- See X(7)
HIST-SPECAn history specification is another convenient form of defining the pair `hist-sz x-sz` for common cases. An history specification can be in either one of the following formats:
- Sets x-sz to N, and hist-sz to N+1.
- Sets hist-sz to N, and x-sz to N/M.
- Sets x-sz to N, and hist-sz to N*M.
While this may seem hard at first, trend fifo '60x3' is an easier way of expressing "60 seconds for 3 minutes" and similar idioms.
COLOURA colour is specified in hex RGB format, as follows: #RRGGBB , RRGGBB or 0xRRGGBB some examples:
GRID-SPECA grid specification is of the form:
(eg: 1.3 , 10+5 , 1x10+5 , +5x+5 ; +1x+1 gets the old behaviour) where:
- y grid resolution
- x grid resolution
- draw a mayor line every C normal grid lines
- cycle current graph
- toggle auto-scaling
- re-scale the graph without activating auto-scaling
- toggle dimmed shading mode
- toggle distribution graph
- toggle anti-aliasing
- switch scrolling mode (wrap-around or scrolling)
- toggle values
- show visual and maximal sync latency
- set limits interactively
- activate a marker on the current cursor position
- toggle filling
- toggle grid
- change grid-spec interactively
- change zero interactively
- set limits by center and amplitude
- change polling rate interactively
- toggle display of undefined values
- toggle the graph key
- cycle view mode (normal, dim others or hide others)
- pause visualisation (but still continue to consume input to preserve time coherency)
AUTOSCALINGWhen autoscaling is enabled the graph will be scaled vertically to fit visible values. The grid resolution is used to add some vertical bounds to the graph. Disabling autoscaling interactively will retain current limits. When the grid is too dense to be displayed it's deactivated automatically.
LATENCY INDICATORThe latency indicator shows a 5s average of the visual and maximal sync latency (in seconds). The visual latency is the time-frame between real value updates and the final output you're seeing: it includes copy/redraw times, which varies depending on enabled layers, plus video sync. The maximal sync latency is the maximal time ever required for any received value to be synced with the display: since the display is updated atomically, values received while redrawing are implicitly delayed. See the Sx UPDATE POLICY section for further details.
SHADING MODESThe default is to shade uniformly old values to complete transparency. The "dimmed" shading mode draws the foreground values with full opacity and the others with half opacity.
SCROLLING MODESThe default visualisation mode is "wrap-around": newer values will simply wrap around the screen when new data arrives. The other available one is "scrolling": new data is always placed at the right edge of the screen, and older values scrolled on the left.
VALUE INDICATORSThree value indicators are drawn on the screen: upper limit, lower limit and current value (respectively on the upper right, lower right and lower left of the screen).
INTERACTIVE EXAMINERSYou can query interactively the graph for any value in the history by clicking with the first mouse button. This will enable a permanent examiner in the selected position and display up to the three nearest values in the upper-left corner of the screen. Intersections are projected horizontally, while a small circle will show the position of the nearest sampled value. The mean value refers to the three intersections.
By holding down the CTRL key while clicking/dragging only "foreground" values will be considered.
When clicking inside the distribution graph, the current count for the selected value is displayed instead.
The examiners can be removed by clicking anywhere with the third mouse button.
DISTRIBUTION GRAPHD or -D enable a distribution graph on the left side of the window. This is especially useful when analyzing the continuity of a function or signal. Intensity is proportional to the visible maximum.
FILLINGf or -F enable filling. In standard mode, or when hist-sz is smaller than x-sz, the area between the curve and zero will be filled. Otherwise, in dimmed mode, the area between the "foreground" and "background" values is filled instead.
- The fifo is read and managed asynchronously from the graphics. Delays at the
- display end will not interfere with the data feed.
- The fifo is unbuffered and the feeder thread is synchronously locked on it
- waiting for new data.
- The value is put in the history buffer when a separator character is received
- after the value, or, for binary input, when the needed amount of bytes is read (in this case each value is read with a single read call).
- The polling rate (as defined by
- p or -p and defaulting to 1000) defines how often the history buffer should be checked for updates and kept in sync with the visual. Values greater than 1000 result in continuous scanning (note that this only affects the maximal sync latency, and not the display rate, which is handled automatically).
- Syncing occurs atomically, reflecting the actual state at the instant of the
- update. Scheduler latencies apply.
ENVIRONMENTDISPLAY See X(7)
EXAMPLESRunning with a named FIFO:
command > fifo
trend fifo ...
Display the number of current active processes over time:
(while true; do ps -A | wc -l; sleep 1; done) | \
trend - 60x24
Display two graphs:
trend -c2a -L"graph 1, graph 2" fifo ...
- trend: producer thread exiting
- The data stream finished for some reason (the specified file was invalid at the time of the request). For regular or invalid files this warning is normal.
AUTHORSis distributed under LGPL (see COPYING) WITHOUT ANY WARRANTY Copyright(c) 2003-2009 by An Yuri D'Elia Aq [email protected] .