The tester stats methods provide a library of functions which are typically used in test scripts for the IN Tester for the purpose of validating statistics counters.
Tester helper methods are accessed via the “n2.n2svcd.tester.stats” module:
local stats = require "n2.n2svcd.tester.stats"
delta method uses the
n2svcd.management_summary method to fetch an
application’s current statistics values.
When called repeatedly, it computes a delta of the statistics counter changes since the previous call.
This allows a test script to validate that the application’s statistics counters have changed by the expected amount as a result of the intermediate test actions.
The parameters for this method are:
[Required] The name of the application whose management summary we are requesting.
This must be a real application name, it cannot be a virtual (load-share/failover) app name.
||Table||The checkpoint object from the previous invocation.|
delta method returns two result values.
A table keyed by statistics names returned from the
The value for each entry is the delta from the previous checkpoint.
||Table||The checkpoint object which should be passed into the next invocation of this method.|
local delta, checkpoint delta, checkpoint = stats.delta ('Logic', checkpoint) [intermediate test processing goes here] delta, checkpoint = stats.delta ('Logic', checkpoint) n2svcd.match_integer ('instance.start', delta['instance.start'], 3) n2svcd.match_integer ('instance.shutdown', delta['instance.shutdown'], 3) n2svcd.match_integer ('messages.rcvd', delta['messages.rcvd'], 1) n2svcd.match_integer ('messages.sent', delta['messages.sent'], 2)