diff --git a/dev-requirements.txt b/dev-requirements.txt index 630bf40..efe1a66 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,7 +9,7 @@ numpy>=1.26.4,<=2.1.1 psutil>=5.9.0,<=6.0.0 packaging>=21.0,<=24.1 -qgate_graph==1.4.15 +qgate_graph==1.4.16 coverage>=7 coverage-badge>=1 diff --git a/qgate_perf/parallel_probe.py b/qgate_perf/parallel_probe.py index 3a2f432..35ca1ce 100644 --- a/qgate_perf/parallel_probe.py +++ b/qgate_perf/parallel_probe.py @@ -39,7 +39,7 @@ def __init__(self, run_setup: RunSetup, exception=None): # key part of init timer (import for stop parallel run) self.init_time = time.time() self.track_start = datetime.datetime.utcnow() - self.track_end=datetime.datetime(1970, 1, 1) + self.track_end = datetime.datetime(1970, 1, 1) def start(self): """ Start measurement each test""" @@ -70,7 +70,7 @@ def stop(self) -> bool: # Is it possible to end performance testing? if (self.stop_time_one_shot - self.init_time) >= self.duration_second: # write time - self.track_end=datetime.datetime.utcnow() + self.track_end = datetime.datetime.utcnow() # calc standard deviation self.standard_deviation = self.stddev.std # release unused sources (we calculated standard deviation) @@ -79,18 +79,18 @@ def stop(self) -> bool: return False @staticmethod - def _wait_for_others(when_start, tollerance=0.1): + def _wait_for_others(when_start, tolerance=0.1): """ Waiting for other executors :param when_start: datetime, when to start execution - :param tollerance: time tollerance in second (when it does not make to wait), default is 100 ms + :param tolerance: time tolerance in second (when it does not make to wait), default is 100 ms """ - # wait till specific time (the time for run is variable for each exector based on system processing and delay) + # wait till specific time (the time for run is variable for each executor based on system processing and delay) sleep_time = when_start - datetime.datetime.now() sleep_time = sleep_time.total_seconds() - # define size of tollerance for synchronization - if sleep_time > tollerance: + # define size of tolerance for synchronization + if sleep_time > tolerance: time.sleep(sleep_time) def __str__(self): @@ -99,16 +99,16 @@ def __str__(self): if self.exception is None: return json.dumps({ FileFormat.PRF_TYPE: FileFormat.PRF_DETAIL_TYPE, - FileFormat.PRF_DETAIL_PROCESSID: self.pid, - FileFormat.PRF_DETAIL_CALLS: self.counter, + FileFormat.PRF_DETAIL_PROCESSID: self.pid, # info + FileFormat.PRF_DETAIL_CALLS: self.counter, # for perf graph FileFormat.PRF_DETAIL_AVRG: math.nan if self.counter == 0 else self.total_duration / self.counter, - FileFormat.PRF_DETAIL_MIN: self.min_duration, - FileFormat.PRF_DETAIL_MAX: self.max_duration, - FileFormat.PRF_DETAIL_STDEV: self.standard_deviation, - FileFormat.PRF_DETAIL_TOTAL: self.total_duration, - FileFormat.PRF_DETAIL_TIME_INIT: self.track_init.isoformat(' '), - FileFormat.PRF_DETAIL_TIME_START: self.track_start.isoformat(' '), - FileFormat.PRF_DETAIL_TIME_END: self.track_end.isoformat(' ') + FileFormat.PRF_DETAIL_MIN: self.min_duration, # info + FileFormat.PRF_DETAIL_MAX: self.max_duration, # info + FileFormat.PRF_DETAIL_STDEV: self.standard_deviation, # for perf graph + FileFormat.PRF_DETAIL_TOTAL: self.total_duration, # for perf graph + FileFormat.PRF_DETAIL_TIME_INIT: self.track_init.isoformat(' '), # for executor graph + FileFormat.PRF_DETAIL_TIME_START: self.track_start.isoformat(' '), # for executor graph + FileFormat.PRF_DETAIL_TIME_END: self.track_end.isoformat(' ') # for executor graph }) else: return ParallelProbe.dump_error(self.exception, self.pid, self.counter) diff --git a/qgate_perf/run_setup.py b/qgate_perf/run_setup.py index d062fad..99e9dd9 100644 --- a/qgate_perf/run_setup.py +++ b/qgate_perf/run_setup.py @@ -7,7 +7,7 @@ def __init__(self, duration_second = 0, start_delay: int = 0, parameters: dict = """ Setup of execution :param duration_second: parameter for duration of atomic execution (it is up to function, - if fuction will reflect the defined value) + if function will reflect the defined value) :param start_delay: maximal time in seconds for waiting to the all executors, after this time all executors will continue in run. It is usefull parameter for executor synchronization, value 0 = without synchronization diff --git a/qgate_perf/version.py b/qgate_perf/version.py index e330c12..60eae3a 100644 --- a/qgate_perf/version.py +++ b/qgate_perf/version.py @@ -1,3 +1,3 @@ # Store the version here so: -__version__ = '0.4.16' \ No newline at end of file +__version__ = '0.4.17' \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 935dae7..d0e1b08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ numpy>=1.26.4,<=2.1.1 psutil>=5.9.0,<=6.0.0 packaging>=21.0,<=24.1 -qgate_graph==1.4.15 +qgate_graph==1.4.16