durationFactory Member Function
Enables the Listener to
create a Duration object on the
stack. The Listener does not keep pointers to the objects returned
by this function. Therefore, delete Duration objects that are created
in this manner after their use. Note, that it is also possible to
create Duration objects by using the new operator.
Duration Accumulators are named "duration" because the Manager Dashboard looks for this Accumulator name.
Syntax
Duration elapsedTime(Accumulator
*AccumulatorObject);Parameters
- AccumulatorObject
- [in] Required pointer to an Accumulator object, which accumulates the time that is recorded by this Duration object. A different Accumulator can be specified for the Duration object by using the start function.
Example
Listener *listener = new Listener("sampleApp", "4.0", NULL, false);
Container *store = listener->lookupContainer("storeName");
Event *creations = store->lookupEvent(PCHeventClass.RPC, "document creations");
Accumulator *numCreations = creations->lookupAccumulator("number of creations");
Duration duration = listener->durationFactory(numCreations);
...