Use the GetStatistics() to get the access to the Scorpion
statistics
The Stateistics object:
Method |
Returns |
Description |
getStatistics(name) |
(int,int,int) |
Returns a tuple of (current,previous,total) for
named item. The name is the non-localized name of states and
'UnknownItem' or 'Sum' |
zero() |
bool |
Transfers current statistics to previous period
and resets current current period |
reset() |
bool |
Resets all statistics |
Example 1, list all statistics
def TestStatistics():
states=GetStateList()
stat=GetStatistics()
for i in range(states.count):
print states.get(i).name,stat.getStatistics(states.get(i).name)
print 'UnknownItem',stat.getStatistics('UnknownItem')
print 'Sum',stat.getStatistics('Sum')
output :
Pass (0, 1435, 1435)
Fail (0, 0, 0)
Error (0, 0, 0)
UnknownItem (0, 0, 0)
Sum (0, 1435, 1435)
|