randomproceduredeclaration

NAME
SYNOPSIS
DESCRIPTION
USAGE
EXAMPLE
COPYRIGHT
SEE ALSO

NAME

randomproceduredeclaration − RWP*Load Simulator declare a random procedure

SYNOPSIS

randomproceduredeclaration ::=
  [ private ] random procedure array identifier
  ( randomprocedurespec { , randomprocedurespec } )

randomprocedurespec ::=
  identifier expression

DESCRIPTION

One of the the purposes of the RWP*Load Simulator is to randomly execute one out of number of "business transaction" in order to simulate a load this is a mixture of these. To do that, you must declare a random procedure array. It contains a number of procedures that are given different weights, which are used to provide the probability of execution.

When a named random procedure is being executed, one of the procedures in the array will be executed with the given probability.

Although you don’t actually declare procedure arguments in a random procedure array declaration, they do take arguments just like a normal procedure, and all procedures used in its definition must take the same arguments; only argument names can be different.

Random procedures can be declared with the private keyword which means they will be local to the file where they are defined, and they cannot be declared locally.

USAGE

The random procedure is given a name that must followed a parenthesized list of procedures with weights. Weights are double values, they cannot be negative and the sum of them must be positive. The weights will be scaled to probabilities in the range [0;1] and when you call the random procedure, one of the procedures will be called with that probability. A procedure with weight zero will never be called, and there must be at least one procedure in the list.

When you call the random procedure, you must provide the list of arguments just as if you called one of the procedures individually.

EXAMPLE

This example first declares four procedures and then a random procedure array:

procedure one(integer x) ... end;
procedure two(integer y) ... end;
procedure three(integer z) ... end;
procedure four(integer x) ... end;


random procedure array doit ( one 10, two 25, three 5, four 60 );

As the sum of the four values is 100, the values are effectively percentages. The net result is that whenever your rwloadsim program executes "doit(value)", the actual execution will with the specified probability be one of those four.

COPYRIGHT

Copyright © 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

SEE ALSO

declaration(1rwl), proceduredeclaration(1rwl)