expsmooth(1M)expsmooth(1M)
ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
NAMEexpsmooth - filter to smooth values from HP-UX WLM data collectors by
computing a running average in which the importance of old values
diminishes (decays) over time
SYNOPSISexpsmooth
[-D ⎪ --debug]
[-d decay factor ⎪ --decay decay factor]
[command [arg ...]]
OPTIONS-D ⎪ --debug
Causes the utility to print debug information
about its operation to stderr during processing.
-d decay factor ⎪ --decay decay factor
Specifies the decay value by which elements are
multiplied. Values must be between 0.0 and 1.0.
The default is 0.1.
command [arg ...]
Specifies a command to execute, then uses its stdout as stdin.
DESCRIPTION
NOTE: As of WLM A.02.02, it is recommended that you use the cntl_smooth
WLM keyword instead of the expsmooth tool. For information on
cntl_smooth, see the wlmconf(4) man page.
expsmooth takes a stream of newline-delimited numbers and outputs a
stream of numbers that are a smoothed version of the metrics. The
smoothing is done with the following formula:
new_smoothed_value =
(decay * newest_input_metric) +
((1 - decay) * last_smoothed_value)
If the decay value is set near 1.0, the contribution of the most recent
metric is large, while the contribution of the previous smoothed value
is small. If the decay value is set nearer 0.0, the opposite is true:
The contribution of the latest metric is small.
The principal use for the expsmooth utility is to remove short spikes
or dips in data collector output used with HP-UX WLM, but it can be
applied to any stream of floating-point numbers.
expsmooth reads values on stdin and exits if end-of-file is detected.
If command is specified, it is executed and its stdout is used as
expsmooth's stdin.
Input
Format the input stream as a single column of floating-point numbers.
Any leading white space is removed, as is any white space or columns
beyond the first number on the line. Empty lines are discarded.
Output
The output of expsmooth is a column of floating-point numbers, with a
new value released each time a new value is received. So, for the fol‐
lowing input:
1
2
3
4
7
and decay value set to 0.25, the output is:
1
1.25
1.6875
2.265625
3.44921875
where the first value, 1, is the average of just (1); the second, 1.25,
is (0.25 * 2) + (0.75 * 1) the third, 1.6875 , is (0.25 * 3) + (0.75 *
1.25) the fourth, 2.265625, is (0.25 * 4) + (0.75 * 1.6875) and the
fifth, 3.44921875, is (0.25 * 7) + (0.75 * 2.265625)
Errors
Errors are reported via stderr and a nonzero exit code.
EXAMPLES
Example 1
Any newline-delimited stream of numbers can be smoothed with expsmooth.
A simple first example is a file containing a series of statistics. A
smoothed stream of metrics values could be generated two ways:
cat statistics_file.txt ⎪ expsmooth--decay 0.6
which is equivalent to
expsmooth--decay 0.6 cat statistics_file.txt
Example 2
For an example that runs continuously (like an HP-UX WLM data collector
would), consider this POSIX shell example:
(while (true); do ps -ef ⎪ wc; done) ⎪ expsmooth--decay -d 0.75
which counts the number of processes every 5 seconds and then uses
expsmooth to return an average.
Example 3
Here, the glance_tt tool is used to collect the average wall clock time
of an application, with expsmooth being used to create a smoothed
value, where 0.5 of the new value is the latest measurement and 0.5 of
the value is from previous contributions.
expsmooth--decay 0.5 \
glance_tt TT_AVERAGE_WALL_TIME shopping_cart purchase
For information on the arguments to the glance_tt tool, see the
glance_tt(1M) man page.
Example 4
Here is an example of driving an HP-UX WLM metric, my_metric, using
expsmooth to filter the output of the tool wlmoradc before the values
are passed to wlmd via the wlmrcvdc utility. The format is:
tune my_metric {
coll_argv =
wlmrcvdc
expsmooth--count 0.6
wlmoradc --instance myOracleDB;
coll_stderr = syslog; # send stderr to syslog
}
From the coll_argv value, HP-UX WLM and the specified data-collection
executables build what is conceptually the same as a pipeline of com‐
mands in a shell, except that in HP-UX WLM the data flows from right to
left instead of from left to right as it does in a shell pipeline.
In the example, wlmoradc collects data and writes them in a nonbuffered
fashion to stdout. The expsmooth utility then reads these values from
stdin, which is connected to wlmoradc's stdout via a pipe, performs the
smoothing transformation on them, and passes the new values to wlmrcvdc
by writing them to stdout. Finally, wlmrcvdc reads the expsmoothed
values from stdin, which is connected to the stdout of expsmooth, and
makes the data collector API calls necessary to pass the values to the
HP-UX WLM control system.
The coll_stderr directive tells wlmd to capture any output to the met‐
ric stream stderr and send it to syslog via logger(1). This is not
required, but can be useful. If wlmoradc or expsmooth report any
errors, they are visible in syslog.
RETURN VALUEexpsmooth returns exit status 0 if no errors occur, or 1 if there are
errors. A last input sample being nonnumeric or a child command
process exiting with a non-zero error code are both considered error
conditions and will result in a non-zero error status for expsmooth.
DEPENDENCIESexpsmooth requires /opt/perl/bin/perl.
AUTHORexpsmooth was developed by HP.
FEEDBACK
If you would like to comment on the current WLM Toolkits functionality
or make suggestions for future releases, please send email to:
wlmfeedback@rsn.hp.com
Version information
@(#) HP WLMTK A.01.10.01 (2006_11_05_16_54_54) hpux_ipf
SEE ALSOwlm(5), wlmtk(5), wlmoradc(1M), wlmd(1M), wlmrcvdc(1M), wlmsend(1M),
glance_tt(1M), smooth(1M)
HP-UX Workload Manager Toolkits User's Guide (/opt/wlm/tool‐
kits/doc/WLMTKug.pdf)
http://www.hp.com/go/wlm WLMTK updates and information
expsmooth(1M)