Version 3.0.2
Last updated: December 1, 2009
The Named Counter service is written in Java and since it is an external service, it must be registered with the SERVICE configuration statement. The syntax is:
SERVICE <ServiceName> LIBRARY JSTAF EXECUTE <Service Jar File Name>
<ServiceName> is the name by which the Named Counter service will be known on this machine.
<Service Jar File Name> is the fully-qualified name of the STAFNamedCounter.jar file.
SERVICE NamedCounter LIBRARY JSTAF EXECUTE c:/STAF/services/namedcounter/STAFNamedCounter.jar
SET SYSTEM VAR STAF/Service/NamedCS/Persist=TrueThe default is NOT to persist the named counters, and as such, if this variable isn't set that is the behaviour which is used.
Increments (or creates if didn't previously exist) the named counter by 1 .
INC <name>
<name> Specifies the name of the counter to increment.
Minimum security level of 4 required to do an INC.
The incremented value of the counter specified is returned.
Decrements the named counter by 1 .
DEC <name>
<name> Specifies the name of the counter to decremented.
Minimum security level of 4 required to do a DEC.
The incremented value of the counter specified is returned.
Gets the value of the named counter.
GET <name>
<name> Specifies the name of the counter.
Minimum security level of 1 required to do a GET.
The value of the counter specified is returned.
Resets the named counter back to Zero.
RESET <name>
<name> Specifies the name of the counter reset.
Minimum security level of 4 required to do a RESET.
The zeroed value for the named counter.
Delete the named counter.
DELETE <name>
<name> Specifies the name of the counter to delete.
Minimum security level of 4 required to do a DELETE.
The counter named will no longer exist.
List all of the named counters, along with their values.
LIST
Minimum security level of 1 required to do a LIST.
A <Map> of <String> representing the counters with the name of the counters as the map keys and the counts as the map values.
ActiveClients : 52 UnexpectedTimeouts: 4 Workload/TestType1: 4 Workload/TestType2: 1 Workload/TestType3: 7 Workload/TestType4: 2 Workload/TestType5: 9
Get details of the commands syntax.
VERSION
Minimum security level of 1 required to do VERSION.
The version of the Named Counter Service.
Get details of the commands syntax.
HELP
Minimum security level of 0 required to do HELP.
The allowable syntax to access the Named Counter Service.
NamedCounter Service Help INC <name> DEC <name> GET <name> RESET <name> DELETE <name> LIST VERSION HELP
In addition to the common STAF return codes, the following Named Counter return codes are defined:
Error Code | Meaning | Comment |
---|---|---|
4001 | Counter Does Not Exist | The specified named counter could not be found. |
4002 | Counter Already Zero | The named counter is currently at Zero. |
4003 | Counter At Max | The named counter is at its maximum possible value. |