Running Flent¶
When run, flent must be supplied either (a) a test name and one or more host names to connect to, or (b) one or more input files containing data from previous runs to post-process.
Test names, hostnames and input file names can all be specified as unqualified
arguments, and flent will do its best to guess which is which. For each
argument, if it is an existing file, it is assumed to be an input file, if it is
the name of an existing test configuration it’s assumed to be a test name, and
if neither of those are true, it is assumed to be a host name. The -i
and -H
switches can be used to explicitly specify the interpretation
of an argument.
Invocation¶
flent [options] <host|test|input file ...>
General options¶
-
-o
OUTPUT
,
--output
=OUTPUT
¶ File to write processed output to (default standard out).
-
-D
DATA_DIR
,
--data-dir
=DATA_DIR
¶ Directory to store data files in. Defaults to the current directory.
-
-i
INPUT
,
--input
=INPUT
¶ File to read input from (instead of running tests). Input files can also be specified as unqualified arguments without using the
-i
switch.
-
-f
FORMAT
,
--format
=FORMAT
¶ Select output format (plot, csv, org_table, stats). Default is no processed output (just writes the JSON data file).
-
-p
PLOT
,
--plot
=PLOT
¶ Select which plot to output for the given test (implies
-f
plot). Use the--list-plots
option to see available plots.
-
-t
TITLE
,
--title-extra
=TITLE
¶ Text to add to plot title and data file name.
-
-n
NOTE
,
--note
=NOTE
¶ Add arbitrary text as a note to be stored in the JSON data file (under the NOTE key in the metadata object).
-
-r
RCFILE
,
--rcfile
=RCFILE
¶ Load configuration data from RCFILE (default ~/.flentrc). See section below for information on the rc file format.
-
-x
,
--extended-metadata
¶
Collect extended metadata and store it with the data file. May include details of your machine you don’t want to distribute; see the section on the data format below.
-
--remote-metadata
=HOSTNAME
¶ Collect extended metadata from a remote host. HOSTNAME is passed verbatim to ssh, so can include hosts specified in ~/.ssh/config. Note that gathering the data can take some time, since it involves executing several remote commands. This option can be specified multiple times and implies
--extended-metadata
.
-
--gui
¶
Run the flent GUI. All other options are used as defaults in the GUI, but can be changed once it is running. The GUI can also be started by running the flent-gui binary. For more information on the GUI, see the The Flent GUI section.
-
--new-gui-instance
¶
Start a new GUI instance. Otherwise, flent will try to connect to an already running GUI instance and have that load any new data files specified as arguments. Implies
--gui
when passed on the command line, but not when set in the rc file. Note that when multiple GUI instances are running, there is no guarantee as to which instance will get a subsequent open request (if run again without--new-gui-instance
).
-
--gui-no-defer
¶
Normally, the GUI defers redrawing plots until they are needed to avoid redrawing all open plots every time an option changes. This switch turns off that optimisation in favour of always redrawing everything straight away. This is useful when loading a bunch of plots from the command line and then wanting to flip through them without drawing delay.
-
-b
BATCH_NAME
,
--batch-name
=BATCH_NAME
¶ Run test batch BATCH_NAME (must be specified in a batch file loaded by the
--batch-file
option). Can be supplied multiple times.
-
-B
BATCH_FILE
,
--batch-file
=BATCH_FILE
¶ Load batch file BATCH_FILE. Can be specified multiple times, in which case the files will be combined (with identically-named sections being overridden by later files). See appropriate section below for an explanation of the batch file format.
-
--batch-override
=key=value
¶ Override parameter ’key’ in the batch config and set it to ’value’. The key name will be case folded to lower case. Can be specified multiple times.
-
--batch-dry-run
¶
Dry batch run. Prints what would be done, but doesn’t actually run any tests.
-
--batch-verbose
¶
Be verbose during batch run: Print all commands executed.
-
--batch-repetitions
=REPETITIONS
¶ Shorthand for
--batch-override
'repetitions=REPETITIONS’
.
-
--batch-title
=TITLE
¶ Shorthand for
--batch-override
'batch_title=TITLE’
.
-
--batch-resume
=DIR
¶ Try to resume a previously interrupted batch run. The argument is the top-level output directory from the previous run.
This will attempt to find a data file in the resume directory and load the BATCH_TIME from the previous run from that and continue. The assumption is that the output directory and filenames are generated from the batch time, so that they will match with the previous run when the same time is used. Then, tests for which data files already exist will be skipped on this run. If the rest of the batch invocation is different from the one being resumed, results may not be what you want.
There’s a check to ensure that the generated output path is a subdirectory of the resume directory, and the whole run will be aborted if it isn’t.
Test configuration options¶
These options affect the behaviour of the test being run and have no effect when parsing input files.
-
-H
HOST
,
--host
=HOST
¶ Host to connect to for tests. For tests that support it, multiple hosts can be specified by supplying this option multiple times. Hosts can also be specified as unqualified arguments; this parameter guarantees that the argument be interpreted as a host name (rather than being subject to auto-detection between input files, hostnames and test names).
-
--local-bind
=IP
¶ Local hostname or IP address to bind to (for test tools that support this). Can be specified multiple times for tests that connect to more than one host; if it is, it must be specified as many times as there are hosts.
-
--remote-host
=idx=HOSTNAME
¶ A remote hostname to connect to when starting a test. The idx is the runner index, which is assigned sequentially to each runner (and so it is not the same as the sequence of hostnames). Look for the ‘IDX’ key in SERIES_META for a test get the idx used here, but note that the idx assignment depends on the exact arguments to the test.
This works by simply prepending ‘ssh HOSTNAME’ to the runner command, so it relies on the same binaries being in the same places on both machines, and won’t work for all runners.
This option can be specified multiple times to have multiple runners run on remote hosts.
-
-l
LENGTH
,
--length
=LENGTH
¶ Base test length (some tests may add some time to this).
-
-s
STEP_SIZE
,
--step-size
=STEP_SIZE
¶ Measurement data point step size.
-
-d
DELAY
,
--delay
=DELAY
¶ Number of seconds to delay parts of test (such as bandwidth loaders).
-
-4
,
--ipv4
¶
Use IPv4 for tests (some tests may ignore this).
-
-6
,
--ipv6
¶
Use IPv6 for tests (some tests may ignore this).
-
--socket-timeout
=SOCKET_TIMEOUT
¶ Socket timeout (in seconds) used for UDP delay measurement, to prevent stalls on packet loss. Only enabled if the installed netperf version is detected to support this (requires SVN version of netperf).
For the default value, see the output of flent
-h
. The value of this parameter is an implicit upper bound on how long a round-trip time that can be measured. As such you may need to adjust it if you are experiencing latency above the default value. Set to 0 to disable.
-
--test-parameter
=key=value
¶ Arbitrary test parameter in key=value format. Key will be case folded to lower case. The values are stored with the results metadata, and so can be used for storing arbitrary information relevant for a particular test run.
In addition to serving as simple metadata, the test parameters can also affect the behaviour of some test configurations. See the Supplied Tests section for information on these.
This option can be specified multiple times to set multiple test parameters.
-
--swap-up-down
¶
Switch upstream and downstream directions for data transfer. This means that ’upload’ will become ’download’ and vice versa. Works by exchanging netperf
TCP_MAERTS
andTCP_STREAM
parameters, so only works for tests that employ these as their data transfer, and only for the TCP streams.
Plot configuration options¶
These options are used to configure the appearance of plot output and only make
sense combined with -f
plot.
-
-z
,
--zero-y
¶
Always start y axis of plot at zero, instead of autoscaling the axis (also disables log scales). Autoscaling is still enabled for the upper bound.
-
--bounds-x
=BOUNDS
¶
-
--bounds-y
=BOUNDS
¶ Specify bounds of the plot axes. If specifying one number, that will become the upper bound. Specify two numbers separated by a comma to specify both upper and lower bounds. To specify just the lower bound, add a comma afterwards. Can be specified twice, corresponding to figures with multiple axes.
-
--label-x
=LABEL
¶
-
--label-y
=LABEL
¶ Override the figure axis labels. Can be specified twice, corresponding to figures with multiple axes.
-
--colours
=COLOURS
¶ Comma-separated list of colours to be used for the plot colour cycle. Can be specified in any format understood by matplotlib (including HTML hex values prefixed with a #).
Yes, this option uses British spelling. No, American spelling is not supported. Deal with it.
-
-I
,
--invert-latency-y
¶
Invert the y-axis for latency data series (making plots show ’better values upwards’).
-
--log-scale
¶
Use logarithmic scale on plots.
-
--norm-factor
=FACTOR
¶ Factor to normalise data by. I.e. divide all data points by this value. Can be specified multiple times, in which case each value corresponds to a data series.
-
--scale-data
=SCALE_DATA
¶ Additional data files to consider when scaling the plot axes (for plotting several plots with identical axes). Note, this displays only the first data set, but with axis scaling taking into account the additional data sets. Can be supplied multiple times; see also
--scale-mode
.
-
-S
,
--scale-mode
¶
Treat file names (except for the first one) passed as unqualified arguments as if passed as
--scale-data
(default as if passed as--input
).
-
--concatenate
¶
Concatenate multiple result sets into one data series. This means that each data file will have its time axis shifted by the preceding series duration and appended to the first data set specified. Only works for data sets from the same test, obviously.
-
--absolute-time
¶
Plot data points with absolute UNIX time on the x-axis. This requires the absolute starting time for the test run to be stored in the data file, and so it won’t work with data files that predates this feature.
-
--subplot-combine
¶
When plotting multiple data series, plot each one on a separate subplot instead of combining them into one plot. This mode is not supported for all plot types, and only works when
--scale-mode
is disabled.
-
--no-print-n
¶
Do not print the number of data points on combined plots. When using plot types that combines results from several test runs, the number of data series in each combined data point is normally added after the series name, (n=X) for X data series. This option turns that off.
-
--no-annotation
¶
Exclude annotation with hostnames, time and test length from plots.
-
--no-title
¶
Exclude title from plots.
-
--override-title
=TITLE
¶ Override plot title with this string. Completely discards the configured title (from the test configuration), as well as the title stored in the data set, and replaces it with the value supplied here. This is useful to override the plot title at the time of plotting, for instance to add a title to an aggregate plot from several data series. When this parameter is specified,
--no-title
has no effect.
-
--override-label
=LABEL
¶ Override dataset label. Can be specified multiple times when multiple datasets are being plotted, in which case the order of labels corresponds to the order of datasets.
Like
--override-title
, this is applied at the time of plotting.
-
--split-group
=LABEL
¶ Split data sets into groups when creating box plots. Specify this option multiple times to define the new groups; the value of each option is the group name.
Say you’re plotting nine datasets which are really testing two variables with three values each. In this case, it can be useful to have the box plot of the results be split into three parts (corresponding to the values of one variable) with each three boxes in each of them (corresponding to the values of the second variable). This option makes this possible; simply specify it three times with the labels to be used for the three groups.
A constraint on this option is that the number of datasets being plotted must be divisible by the number of groups.
-
--no-markers
¶
Don’t use line markers to differentiate data series on plots.
-
--no-legend
¶
Exclude legend from plots.
-
--horizontal-legend
¶
Place a horizontal legend below the plot instead of a vertical one next to it. Doesn’t work well if there are too many items in the legend, obviously.
-
--legend-title
=LEGEND_TITLE
¶ Override legend title on plot.
-
--legend-placement
=LEGEND_PLACEMENT
¶ Control legend placement. Enabling this option will place the legend inside the plot at the specified location. Use ‘best’ to let matplotlib decide.
-
--filter-legend
¶
Filter legend labels by removing the longest common substring from all entries. This is not particularly smart, so should be used with care.
-
--filter-regexp
=REGEXP
¶ Filter the plot legend by the supplied regular expression. Note that for combining several plot results, the regular expression is also applied before the grouping logic, meaning that a too wide filter can mess up the grouping.
-
--filter-series
=SERIES
¶ Filter out specified series from plot. Can be specified multiple times.
-
--skip-missing-series
¶
Skip missing series entirely from plots. Only works for bar plots.
-
--replace-legend
=src=dest
¶ Replace ‘src’ with ‘dst’ in legends. Can be specified multiple times.
-
--figure-width
=FIG_WIDTH
¶ Figure width in inches. Used when saving plots to file and for default size of the interactive plot window.
-
--figure-height
=FIG_HEIGHT
¶ Figure height in inches. Used when saving plots to file and for default size of the interactive plot window.
-
--figure-dpi
=FIG_DPI
¶ Figure DPI. Used when saving plots to raster format files.
-
--no-matplotlibrc
¶
Don’t load included matplotlibrc values. Use this if autodetection of custom matplotlibrc fails and flent is inadvertently overriding rc values.
-
--no-hover-highlight
¶
Don’t highlight data series on hover in interactive plot views. Use this if redrawing is too slow, or the highlighting is undesired for other reasons.
Data combination configuration¶
These options are used to combine several datasets, for instance to make aggregate plots.
-
--override-group-by
=GROUP
¶ Override the
group_by
setting for combination plots. This is useful to, for instance, switch to splitting up combined data sets by batch run instead of by file name.
-
--combine-save-dir
=DIRNAME
¶ When doing a combination plot save the intermediate data to
DIRNAME
. This can then be used for subsequent plotting to avoid having to load all the source data files again on each plot.
Misc and debugging options:¶
-
-L
LOG_FILE
,
--log-file
=LOG_FILE
¶ Write debug log (test program output) to log file.
-
--list-tests
¶
List available tests and exit.
-
--list-plots
¶
List available plots for selected test and exit.
-
-V
,
--version
¶
Show Flent version information and exit.
-
-h
,
--help
¶
Show usage help message and exit.
Signals¶
Flent will abort what it is currently doing on receiving a SIGINT – this includes killing all runners, cleaning up temporary files and shutting down as gracefully as possible. Runners are killed with SIGTERM in this mode, and their output is discarded. If a batch run is in progress, the current test will be interrupted in this way, and the rest of the batch run is aborted. Previously completed tests and their results are not aborted. Post-commands marked as ’essential’ will be run after the test is interrupted. Additionally, flent converts SIGTERM into SIGINT internally and reacts accordingly.
Upon receiving a SIGUSR1, flent will try to gracefully abort the test it is currently running, and parse the output of the runners to the extent that any such output exists. That is, each runner will be killed by a SIGINT, which will cause a graceful shutdown for at least ping and netperf (although netperf running in TCP_MAERTS mode will bug out when interrupted like this, so end-of-tests statistics will be missing). Flent will only react once to a SIGUSR1, sending exactly one SIGINT to the active runners, then wait for them to exit. This may take several seconds in the case of netperf. If the runners for some reason fail to exit, flent will be stuck and will need to be killed with SIGINT. If running in batch mode, SIGUSR1 will only affect the currently running test; subsequent tests will still be run.