Skip to content

Commit fd784cf

Browse files
authored
Merge pull request #96 from george0st/changes
Extend results info
2 parents 93a9ab6 + aa03f66 commit fd784cf

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

qgate_perf/output_result.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,33 @@ class PerfResults:
7373
def __init__(self):
7474
self._results = []
7575
self._state = True
76+
self._count_states = 0
77+
self._count_false_states = 0
7678

7779
@property
7880
def results(self) -> list[PerfResult]:
7981
return self._results
8082

8183
@property
8284
def state(self):
85+
"""Return total state, cross all results"""
8386
return self._state
8487

88+
@property
89+
def count_states(self):
90+
"""Return count of all states"""
91+
return self._count_states
92+
93+
@property
94+
def count_false_states(self):
95+
"""Return count of false/ERR states"""
96+
return self._count_false_states
97+
8598
def add_state(self, state):
86-
if state == False:
99+
self._count_states += 1
100+
if not state:
87101
self._state = False
102+
self._count_false_states += 1
88103

89104
def append(self, item):
90105

qgate_perf/parallel_executor.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ def run_bulk_executor(self,
139139
:param executor_list: list of executors for execution in format [[processes, threads, 'label'], ...]
140140
:param run_setup: setup of execution
141141
:param sleep_between_bulks: sleep between bulks
142-
:param performance_detail: add to the return also performance details (default is False)
143-
:return: return performance results with key information about the 'state'. The state
144-
True - all executions was without exceptions, False - some exceptions.
142+
:param performance_detail: add to the return also performance details or only state info (default is False - only state info)
143+
:return: return performance results (see the param 'performance_detail') with key information about the 'state'.
144+
The state True - all executions was without exceptions/errors, False - some exceptions.
145145
"""
146146
performance = PerfResults()
147147
count = 0
@@ -173,9 +173,9 @@ def run_executor(self, executor_list = [[2, 1, '1x thread'], [2, 2, '2x thread']
173173
174174
:param executor_list: list of executors for execution in format [[processes, threads, 'label'], ...]
175175
:param run_setup: setup of execution
176-
:param performance_detail: add to the return also performance details (default is False)
177-
:return: return performance results with key information about the 'state'. The state
178-
True - all executions was without exceptions, False - some exceptions.
176+
:param performance_detail: add to the return also performance details or only state info (default is False - only state info)
177+
:return: return performance results (see the param 'performance_detail') with key information about the 'state'.
178+
The state True - all executions was without exceptions/errors, False - some exceptions.
179179
"""
180180
performance = PerfResults()
181181
output = None
@@ -232,9 +232,9 @@ def run(self, processes = 2, threads = 2, run_setup: RunSetup = None, performanc
232232
:param processes: how much processes will be used
233233
:param threads: how much threads will be used
234234
:param run_setup: setup of execution
235-
:param performance_detail: add to the return also performance details (default is False)
236-
:return: return performance results with key information about the 'state'. The state
237-
True - all executions was without exceptions, False - some exceptions.
235+
:param performance_detail: add to the return also performance details or only state info (default is False - only state info)
236+
:return: return performance results (see the param 'performance_detail') with key information about the 'state'.
237+
The state True - all executions was without exceptions/errors, False - some exceptions.
238238
"""
239239
performance = PerfResults()
240240
output = None
@@ -285,9 +285,9 @@ def one_run(self, run_setup: RunSetup = None, performance_detail = False) -> Per
285285
""" Run test, only one call, execution in new process, with standard write outputs
286286
287287
:param run_setup: setting for run
288-
:param performance_detail: add to the return also performance details (default is False)
289-
:return: return performance results with key information about the 'state'. The state
290-
True - all executions was without exceptions, False - some exceptions.
288+
:param performance_detail: add to the return also performance details or only state info (default is False - only state info)
289+
:return: return performance results (see the param 'performance_detail') with key information about the 'state'.
290+
The state True - all executions was without exceptions/errors, False - some exceptions.
291291
"""
292292

293293
# setup minimalistic values

qgate_perf/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Store the version here so:
22

3-
__version__ = '0.4.48'
3+
__version__ = '0.4.49'

0 commit comments

Comments
 (0)