HP-UX Workload Manager User's Guide

Advanced WLM usage: Using performance metrics
Supplying data to WLM
Appendix H 503
/opt/wlm/include/wlm.h
NOTE This function is not thread-safe: Multiple threads cannot call the
function at the same time.
The syntax is:
ssize_t wlm_mon_write(int handle_id, void *buf, size_t
numbytes);
where
handle_id
Is the handle identifier returned by the
wlm_mon_attach() call.
buf
Is a pointer to the double-precision floating-point value
to be transferred to the data queue.
numbytes
Is the number of bytes to write to the data queue. The
data must be of type double. Thus, the value of this
parameter must be sizeof(double).
The exit status values for wlm_mon_write() are:
>= 0 Success (number of bytes written)
-1 Failureif errno is not EAGAIN, your data collector
should exit
Example:
if (metric_cnt > 0) {
metric_avg = metric_sum / metric_cnt;
if (wlm_mon_write(handle_id, &metric_avg,
sizeof(double)) == -1) {
fprintf(output, “wlm_mon_write failed: %s\n”, strerror(errno));
exit(1);
}
}