kb_python.stats
¶
Module Contents¶
Classes¶
Stats |
Class used to collect kb run statistics. |
-
class
kb_python.stats.
Stats
¶ Class used to collect kb run statistics.
-
start
(self)¶ Start collecting statistics.
Sets start time, the command line call, and the commands array to an empty list.
-
command
(self, command, runtime=None)¶ Report a shell command was run.
Parameters: - command (list) – a shell command, represented as a list
- kwargs (dict) – additional command information
-
end
(self)¶ End collecting statistics.
-
save
(self, path)¶ Save statistics as JSON to path.
Parameters: path (str) – path to JSON Returns: path to saved JSON Return type: str
-
to_dict
(self)¶ Convert statistics to dictionary, so that it is easily parsed by the report-rendering functions.
-
-
kb_python.stats.
STATS
¶