smooth(1M)smooth(1M)
ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
NAMEsmooth - filter to smooth HP-UX WLM data collector values by averaging
them on a running basis
SYNOPSISsmooth
[-D ⎪ --debug]
[-c <number of data points> ⎪ --count <number of data points>]
[command [arg ...]]
OPTIONS-D
--debug
Causes the utility to print debug information about its operation
to stderr during processing.
-c <number of data points>
--count <number of data points>
Specifies the number of points over which to compute the
average. The default is 4. Values less than 1 are illegal. A value
of 1 causes the columns to be parsed, white space removed, and so
forth. However, averaging over a single data point simply returns
the most recent value.
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 smooth tool. For information on cntl_smooth,
see the wlmconf(4) man page.
smooth is a filter designed to take a stream of newline-delimited num‐
bers and output a stream of numbers that are a running average of the
last number of data points values. number of data points can be speci‐
fied on the command line with the --count option. The principal use for
the smooth utility is to remove short spikes or dips in data collector
output used with HP-UX WLM, but can be applied to any stream of float‐
ing-point numbers.
smooth 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
smooth'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 smooth is a column of floating-point numbers, with a new
value released each time a new value is received. At startup, until at
least number of data points values have been received, a running aver‐
age of all data points is calculated. So, for the following input:
1
2
3
4
7
and number of data points set to four, the output is:
1
1.5
2
2.5
4
where the first value, 1, is the average of just (1); the second, 1.5,
is the average of (1,2); the third, 2, is the average of (1,2,3); the
fourth, 2, is the average of (1,2,3,4); and the fifth, 4, is the aver‐
age of (2,3,4,7).
Errors
Errors are reported via stderr, and a nonzero exit code.
EXAMPLES
Example 1
Any newline-delimited stream of numbers can be smoothed. A simple first
example is a file containing a series of statistics. A running average
over 8 data points could be generated two ways:
cat statistics_file.txt ⎪ smooth--count 8
which is equivalent to
smooth--count 8 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) ⎪ smooth--count 12
which counts the number of processes every 5 seconds and then uses
smooth to return an average of the last 12 samples.
Example 3
Here, the glance_tt tool is used to collect the average wall clock time
of an application, with smooth being used to create a running average
over the last 8 data points.
smooth--count 8 \
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
smooth 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
smooth--count 8
wlmoradc --instance myOracleDB;
coll_stderr = 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 smooth 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 smoothed values
from stdin, which is connected to the stdout of smooth, and makes the
Data Collector API calls necessary to pass the values on to the HP-UX
WLM control system.
The "coll_stderr = syslog" line captures any standard error output from
the wlmrcvdc, smooth, and wlmoradc commands and sends it to syslog.
The coll_stderr feature was introduced with WLM A.02.01. For more
information, see wlmconf(4) and the 'Stream collectors' section of
wlm(5).
RETURN VALUEsmooth 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 nonzero error code are both considered error
conditions and will result in a nonzero error status for smooth.
LIMITATIONS
The average is recomputed each interval from all stored data points, so
very large values of --count may consume substantial CPU or memory
resources.
DEPENDENCIESsmooth requires /opt/perl/bin/perl.
AUTHORsmooth 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)
HP-UX Workload Manager Toolkits User's Guide
(/opt/wlm/toolkits/doc/WLMTKug.pdf)
http://www.hp.com/go/wlm
WLMTK updates and information
smooth(1M)