beautypg.com

Example 6-5, Using measmonstatus and measstatus – HP NonStop G-Series User Manual

Page 132

background image

Creating a Custom Measurement Application

Measure User’s Guide 520560-003

6- 20

Checking the Status of the Subsystem or a

Measurement

The MEASSTATUS procedure call returns this information about an active
measurement:

The CPUs being measured. If any entity is being measured in a CPU and a
MEASCTL process is running in that CPU, the bit corresponding to the CPU
number is set in the parameter of the returned CPU.

The measurement start, stop, and interval times. If the measurement was started
without a stop or interval time, MEASSTATUS returns -1 in the

stoptime

or

interval

parameter.

The number of entities of each type that are being measured. This information is
returned in an array of MAX^T + 1 words. The first word is always zero. The
remaining words are ordered by numeric identifier (1 for CPU, and so on).

The counter space, in words, used by each entity type. This information is returned
in an array of MAX^T + 1 words and is the same format as the

entities

array.

Example 6-5

calls MEASMONSTATUS and searches the array of data file names

returned by MEASMONSTATUS for the file called CPU0DATA. If the file is found,
MEASMONSTATUS assigns the index into the array to the variable

measnum

. It then

calls MEASSTATUS, passing it the measurement number in

measnum

, and checks the

entities

array returned by MEASSTATUS to determine whether the measurement is

measuring PROCESS entities.

Example 6-5. Using MEASMONSTATUS and MEASSTATUS (page 1 of 2)

LITERAL MAX^NUM^MEASUREMENTS = 64;

STRUCT .MEASNAMES[0:MAX^NUM^MEASUREMENTS-1];
BEGIN
INT FNAME[0:11];
END;

INT MEASUREMENTS,
ERROR,
CPUS,
MEASNUM;

FIXED STARTTIME,
STOPTIME,
INTERVAL;

INT(32) .ENTITIES[0:MAX^T],
.CTRSPACE[0:MAX^T];
.
.
.
! Call MEASMONSTATUS to get the measurement number.
! If you have already used the Measure control block
! (MEASCB) do not initialize it again.