scenario.stats module¶
Common statistics.
- class TimeStats¶
Bases:
objectCommon time statistics.
- __init__()¶
Initializes the time statistics with
Nonevalues.
- _start¶
Start time, if specified.
- _elapsed¶
Elapsed time, if specified.
- _end¶
End time, if specified.
- __str__()¶
Computes a string representation of the time interval in the ‘[%s - %s]’ form.
- Returns:
String representation of the time interval.
- property start¶
Start time getter.
- property elapsed¶
Elapsed time getter.
- property end¶
End time getter.
- setstarttime()¶
Starts the time statistics with the current time.
- setendtime()¶
Ends the time statistics with the current time.
- class ExecTotalStats¶
Bases:
objectExecutable item statistics: number of executed items over a total count.
- __init__()¶
Initializes the count statistics with
0.
- total¶
Total count of executable items.
- executed¶
Count of items executed.
- __str__()¶
Computes a ‘%d’ or ‘%d/%d’ string representation of the statistics, depending on the
args.Args.doc_onlyparameter.- Returns:
String representation of the statistics.
- add(stats)¶
Integrates a tier
ExecTotalStatsinstance into this one.- Parameters:
stats – Tier
ExecTotalStatsinstance.- Returns:
Self (named parameter idiom).
Increments both executed and total counts with the tier’s values.
- tojson()¶
Converts the
ExecTotalStatsinstance into a JSON dictionary.- Returns:
JSON dictionary, with ‘executed’ and ‘total’
intfields.
- static fromjson(json_data)¶
Builds a
ExecTotalStatsinstance from its JSON representation.- Parameters:
json_data – JSON dictionary, with ‘executed’ and ‘total’
intfields.- Returns:
New
ExecTotalStatsinstance.