RSiGetValue Subroutine

Purpose

Returns a data value for a given SpmiStatVals pointer by extraction from the data_feed packet. This subroutine call should only be issued from a callback function after it has been verified that a data_feed packet was received from the host identified by the first argument.

Library

RSI Library (libSpmi.a)

Syntax

#include sys/Rsi.h
float RSiGetValue(rhandle, svp)
RSiHandle rhandle;
struct SpmiStatVals *svp;

Description

The RSiGetValue subroutine provides the following:

  1. Finds an SpmiStatVals structure in the received data packet based upon the second argument to the subroutine call. This involves a lookup operation in tables maintained internally by the RSi interface.
  2. Determines the format of the data field as being either SiFloat or SiLong and extracts the data value for further processing based upon its data format.
  3. Determines the value as either of type SiQuantity or SiCounter. If the former is the case, the data value returned is the val field in the SpmiStatVals structure. If the latter type is found, the value returned by the subroutine is the val_change field divided by the elapsed number of seconds since the previous data packet's time stamp.

This subroutine is part of the Performance Toolbox for AIX® licensed product.

Parameters

rhandle
Must point to a valid RSiHandle handle, which was previously initialized by the RSiOpen (RSiOpen Subroutine) subroutine.
svp
A handle of type struct SpmiStatVals, which was previously returned by a successful RSiPathAddSetStat (RSiPathAddSetStat Subroutine) subroutine call.

Return Values

If successful, the subroutine returns a non-negative value; otherwise it returns a negative value less than or equal to -1.0. A NULL error text is placed in the external character array RSiEMsg regardless of the subroutine's success or failure.

Error Codes

All Remote Statistic Interface (RSI) subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the RSiErrno variable is set to RSiOkay and the RSiEMsg character array is empty. If an error is detected, the RSiErrno variable returns an error code, as defined in the enum RSiErrorType.

Files

Item Description
/usr/include/sys/Rsi.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the RSI.