Skip to content

Commit

Permalink
[pylibs] otns-performance stress test runs with fixed random seed (to…
Browse files Browse the repository at this point in the history
… get a more predictable baseline performance for number of events)
  • Loading branch information
EskoDijk committed Jun 11, 2024
1 parent dd5d743 commit c167328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pylibs/stress_tests/BaseStressTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def run_wrapper(self: 'BaseStressTest', report=True):


class BaseStressTest(object, metaclass=StressTestMetaclass):
def __init__(self, name, headers, web=True, raw=False):
def __init__(self, name, headers, web=True, raw=False, rand_seed=0):
self.name = name
self._otns_args = ['-log','info','-logfile','none'] # use ['-log', 'debug'] for more debug messages
self._otns_args = ['-log','info','-logfile','none','-seed',str(rand_seed)] # use ['-log', 'debug'] for more debug messages
if raw:
self._otns_args.append('-ot-script')
self._otns_args.append('none')
Expand Down
3 changes: 2 additions & 1 deletion pylibs/stress_tests/otns_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class OtnsPerformanceStressTest(BaseStressTest):
def __init__(self):
super(OtnsPerformanceStressTest, self).__init__("OTNS Performance Test",
['Simulation Time', 'Execution Time', 'Speed Up',
'Alarm Events', 'Radio Events'])
'Alarm Events', 'Radio Events'],
rand_seed=48392)

def run(self):
ns = self.ns
Expand Down

0 comments on commit c167328

Please sign in to comment.