Measure User's Guide

Creating a Custom Measurement Application
Measure User’s Guide520560-003
6-10
Step 3: Call MEASCONTROL
Step 3: Call MEASCONTROL
You must call MEASCONTROL and pass it the measurement number returned by
MEASCONFIGURE and a specific start time in the starttime parameter. You can
also specify a stop time for the measurement in the first or a subsequent call to
MEASCONTROL.
Specify the current time so that the measurement starts immediately. If you omit the
starttime parameter or give it a value of -1, the measurement does not start until
you call MEASCONTROL again and pass a specific start time.
You can specify a measurement interval when you call MEASCONTROL. After the
measurement starts, you cannot change the interval.
To stop a measurement, specify a stop time in one of:
The MEASCONTROL call used to start the measurement
A subsequent MEASCONTROL call
If you do not specify a stop time when you start a measurement, the measurement
runs until you call MEASCONTROL again and pass it a stop time. You must omit the
starttime parameter in this call (or give it a value of -1). If you specify the current
time in the stoptime parameter, the measurement stops immediately.
Step 4: Call MEASCLOSE (Optional)
To close a data file and free MEASFH resources, call MEASCLOSE. The
measurement continues even though the user process closes the data file.
Example 6-2 on page 6-11:
1. Defines a measurement configuration that measures all CPUs on a system except
CPU 0
2. Creates and opens a data file with a call to MEASOPEN
3. Passes the configuration table to MEASCONFIGURE
4. Starts the measurement immediately by a call to MEASCONTROL
5. Later stops the measurement with another call to MEASCONTROL