Skip to content

Commit

Permalink
Merge pull request #32 from george0st/changes
Browse files Browse the repository at this point in the history
Bump qgate-graph
  • Loading branch information
george0st authored Sep 5, 2024
2 parents 7cefa48 + 8439a08 commit 1f8b21e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions qgate_perf/parallel_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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)
Expand All @@ -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):
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion qgate_perf/run_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.16'
__version__ = '0.4.17'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1f8b21e

Please sign in to comment.