diff --git a/devices/test/devices/monitoring_performance_test.py b/devices/test/devices/monitoring_performance_test.py index 3d0a809cef5355bcd7e800552c4b9dff464b8e2b..45d52032413751515a9586ee51c195ae9590faa7 100644 --- a/devices/test/devices/monitoring_performance_test.py +++ b/devices/test/devices/monitoring_performance_test.py @@ -16,13 +16,14 @@ sys.path.append(parentdir) import time import numpy +from argparse import ArgumentParser from tango import DevState, Util from tango.server import run, Device, attribute from numpy import random __all__ = ["Monitoring_Performance_Device", "main"] -POLLING_THREADS = 1 +POLLING_THREADS = 10 ARRAY_SIZE = 10000 class Monitoring_Performance_Device(Device): @@ -112,6 +113,16 @@ class Monitoring_Performance_Device(Device): def main(args = None, **kwargs): + print('*{}\n*{}\n'.format(args, kwargs)) + parser = ArgumentParser() + global POLLING_THREADS, ARRAY_SIZE + parser.add_argument("--threads", "-t", dest = "threads", help = "The number of polling threads.", type = int, default = POLLING_THREADS, required = True) + parser.add_argument("--array_size", "-a", dest = "size", help = "The size of the four numpy arrays.", type = int, default = ARRAY_SIZE, required = True) + from sys import argv + args = argv[1:] + settings = parser.parse_known_args(args) + POLLING_THREADS = settings['threads'] + ARRAY_SIZE = settings['size'] return run((Monitoring_Performance_Device, ), args = args, **kwargs) if __name__ == '__main__':