beautypg.com

Step 1: source in the measdecs file, Step 4: bump the counter (call meascounterbump) – HP NonStop G-Series User Manual

Page 98

background image

Defining Custom Counters

Measure User’s Guide 520560-003

5 -2

Step 1: Source in the MEASDECS File

Step 1: Source in the MEASDECS File

The MEASDECS file contains the literal values that are passed to the
MEASCOUNTERBUMP procedure. MEASDECS is located on $SYSTEM.SYS

nn

,

where SYS

nn

is the subvolume that contains the OSIMAGE file.

Step 2: Declare Integer Variable, Array, and Offset

Declare the following:

When you name counters:

You can specify a separate name for each counter or a single name that refers to
an array of counters. (In either case, the counter name is declared in the same
way.)

You can use uppercase and lowercase letters. Alphabetic characters are not case
sensitive.

Counters of the same name in the same program refer to the same counter, but
counters of the same name in different programs refer to different counters.

Step 3: Initialize the Counter (Call MEASCOUNTERBUMPINIT)

1. Call MEASCOUNTERBUMPINIT to initialize the counter within the user-defined

record.

MEASCOUNTERBUMPINIT returns the counter offset in

offset

.

2. Pass

counter

as the first parameter and

offset

as the second parameter.

If the counter specified is not part of a currently active measurement,
MEASCOUNTERBUMPINIT returns the literal value ERR^UDCNOTPRESENT in

error

and -1 in

offset.

Always check for the ERR^UDCNOTPRESENT error.

Step 4: Bump the Counter (Call MEASCOUNTERBUMP)

1. Call MEASCOUNTERBUMP to bump the counter.

2. Pass

offset

as the first parameter and

bumptype

as the second parameter.

bumptype

determines how MEASCOUNTERBUMP bumps a counter. Literal

values for

bumptype

are ADD, INC, SETBUSY, RESETBUSY, INCQUEUE, and

DECQUEUE, as described in

Example 5-1

on page 5-3.

error

An integer variable that holds the function values returned by the
MEASCOUNTERBUMPINIT and MEASCOUNTERBUMP procedures.

counter

An integer array, eight words long, that contains the counter name. Declare
one

counter

variable for each counter name.

offset

An integer variable that holds the location of the counter within the internal
user-defined counter record. Declare one

offset

variable for each counter.