Skip to content

Commit

Permalink
Merge pull request #96 from george0st/changes
Browse files Browse the repository at this point in the history
Extend results info
  • Loading branch information
george0st authored Nov 10, 2024
2 parents 93a9ab6 + aa03f66 commit fd784cf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
17 changes: 16 additions & 1 deletion qgate_perf/output_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,33 @@ 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]:
return self._results

@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):

Expand Down
24 changes: 12 additions & 12 deletions qgate_perf/parallel_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion qgate_perf/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Store the version here so:

__version__ = '0.4.48'
__version__ = '0.4.49'

0 comments on commit fd784cf

Please sign in to comment.