Skip to content

Commit

Permalink
Merge pull request #70 from george0st/changes
Browse files Browse the repository at this point in the history
Support percentile
  • Loading branch information
george0st authored Oct 13, 2024
2 parents c7e9d27 + 815550a commit 1520e8d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 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.22
qgate_graph==1.4.23

coverage>=7
coverage-badge>=1
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.33'
__version__ = '0.4.34'
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.22
qgate_graph==1.4.23
26 changes: 24 additions & 2 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def tearDownClass(cls):
pass

def test_graph(self):
"""Basic test"""
generator = ParallelExecutor(prf_test,
label="test_aus_ger",
detail_output=True,
Expand All @@ -79,6 +80,7 @@ def test_graph(self):
print(file[0])

def test_graph_run_exception(self):
"""Simply run and exceptions"""
generator = ParallelExecutor(prf_test,
label="test_exception",
detail_output=True,
Expand All @@ -96,6 +98,7 @@ def test_graph_run_exception(self):
print(file[0])

def test_graph_runexecutor_exception(self):
"""Executor list and exceptions"""
generator = ParallelExecutor(prf_test,
label="test_exception2",
detail_output=True,
Expand All @@ -118,6 +121,7 @@ def test_graph_runexecutor_exception(self):


def test_graph_runbulkexecutor_exception_random(self):
"""Bulk bundles and executor list with executions"""
generator = ParallelExecutor(prf_test,
label="test_random",
detail_output=True,
Expand All @@ -141,6 +145,7 @@ def test_graph_runbulkexecutor_exception_random(self):
print(file[0])

def test_graph_scope(self):
"""Test scope with Perf, Perf_RAW and Exe"""
generator = ParallelExecutor(prf_test,
label="test_graph_scope",
detail_output=True,
Expand All @@ -158,16 +163,33 @@ def test_graph_scope(self):
file=glob.glob(path.join(self.OUTPUT_ADR, "graph-exec", "1 sec", today, f"EXE-test_graph_scope-*-bulk-10x10-*.png"))
self.assertTrue(len(file) == 0) # without these file


generator.create_graph(self.OUTPUT_ADR, GraphScope.perf_raw)
today = datetime.datetime.now().strftime("%Y-%m-%d")
file=glob.glob(path.join(self.OUTPUT_ADR, "graph-perf", "1 sec", today, f"PRF-test_graph_scope-RAW-*-bulk-10x10.png"))
self.assertTrue(len(file) == 1)
file=glob.glob(path.join(self.OUTPUT_ADR, "graph-exec", "1 sec", today, f"EXE-test_graph_scope-*-bulk-10x10-*.png"))
self.assertTrue(len(file) == 0) # without these file


generator.create_graph(self.OUTPUT_ADR, GraphScope.exe)
today = datetime.datetime.now().strftime("%Y-%m-%d")
file=glob.glob(path.join(self.OUTPUT_ADR, "graph-exec", "1 sec", today, f"EXE-test_graph_scope-*-bulk-10x10-*.png"))
self.assertTrue(len(file) == 2)

def test_graph_percentile(self):

generator = ParallelExecutor(prf_test,
label="test_percentile",
detail_output=True,
output_file=path.join(self.OUTPUT_ADR, "perf_test_percentile.txt"))

setup=RunSetup(duration_second=2, start_delay=2, parameters={"percentile": 0.95})
generator.run_bulk_executor([[1,1], [1,5]], [[4,4],[8,4],[16,4]], setup)
generator.create_graph_perf(self.OUTPUT_ADR)

today = datetime.datetime.now().strftime("%Y-%m-%d")

# check relevant files
file=glob.glob(path.join(self.OUTPUT_ADR, "graph-perf", "2 sec", today, f"PRF-test_percentile-*-bulk-*.png"))
self.assertTrue(len(file)==2)
print(file[0])

0 comments on commit 1520e8d

Please sign in to comment.