diff --git a/qgate_perf/output_result.py b/qgate_perf/output_result.py index 0feafac..dd3bebd 100644 --- a/qgate_perf/output_result.py +++ b/qgate_perf/output_result.py @@ -73,6 +73,8 @@ class PerfResults: def __init__(self): self._results = [] self._state = True + self._count_states = 0 + self._count_false_states = 0 @property def results(self) -> list[PerfResult]: @@ -80,11 +82,24 @@ def results(self) -> list[PerfResult]: @property def state(self): + """Return total state, cross all results""" return self._state + @property + def count_states(self): + """Return count of all states""" + return self._count_states + + @property + def count_false_states(self): + """Return count of false/ERR states""" + return self._count_false_states + def add_state(self, state): - if state == False: + self._count_states += 1 + if not state: self._state = False + self._count_false_states += 1 def append(self, item): diff --git a/qgate_perf/parallel_executor.py b/qgate_perf/parallel_executor.py index b1ff377..5a4dd90 100644 --- a/qgate_perf/parallel_executor.py +++ b/qgate_perf/parallel_executor.py @@ -139,9 +139,9 @@ def run_bulk_executor(self, :param executor_list: list of executors for execution in format [[processes, threads, 'label'], ...] :param run_setup: setup of execution :param sleep_between_bulks: sleep between bulks - :param performance_detail: add to the return also performance details (default is False) - :return: return performance results with key information about the 'state'. The state - True - all executions was without exceptions, False - some exceptions. + :param performance_detail: add to the return also performance details or only state info (default is False - only state info) + :return: return performance results (see the param 'performance_detail') with key information about the 'state'. + The state True - all executions was without exceptions/errors, False - some exceptions. """ performance = PerfResults() count = 0 @@ -173,9 +173,9 @@ def run_executor(self, executor_list = [[2, 1, '1x thread'], [2, 2, '2x thread'] :param executor_list: list of executors for execution in format [[processes, threads, 'label'], ...] :param run_setup: setup of execution - :param performance_detail: add to the return also performance details (default is False) - :return: return performance results with key information about the 'state'. The state - True - all executions was without exceptions, False - some exceptions. + :param performance_detail: add to the return also performance details or only state info (default is False - only state info) + :return: return performance results (see the param 'performance_detail') with key information about the 'state'. + The state True - all executions was without exceptions/errors, False - some exceptions. """ performance = PerfResults() output = None @@ -232,9 +232,9 @@ def run(self, processes = 2, threads = 2, run_setup: RunSetup = None, performanc :param processes: how much processes will be used :param threads: how much threads will be used :param run_setup: setup of execution - :param performance_detail: add to the return also performance details (default is False) - :return: return performance results with key information about the 'state'. The state - True - all executions was without exceptions, False - some exceptions. + :param performance_detail: add to the return also performance details or only state info (default is False - only state info) + :return: return performance results (see the param 'performance_detail') with key information about the 'state'. + The state True - all executions was without exceptions/errors, False - some exceptions. """ performance = PerfResults() output = None @@ -285,9 +285,9 @@ def one_run(self, run_setup: RunSetup = None, performance_detail = False) -> Per """ Run test, only one call, execution in new process, with standard write outputs :param run_setup: setting for run - :param performance_detail: add to the return also performance details (default is False) - :return: return performance results with key information about the 'state'. The state - True - all executions was without exceptions, False - some exceptions. + :param performance_detail: add to the return also performance details or only state info (default is False - only state info) + :return: return performance results (see the param 'performance_detail') with key information about the 'state'. + The state True - all executions was without exceptions/errors, False - some exceptions. """ # setup minimalistic values diff --git a/qgate_perf/version.py b/qgate_perf/version.py index 8c88072..47d0023 100644 --- a/qgate_perf/version.py +++ b/qgate_perf/version.py @@ -1,3 +1,3 @@ # Store the version here so: -__version__ = '0.4.48' \ No newline at end of file +__version__ = '0.4.49' \ No newline at end of file