Skip to content
Snippets Groups Projects
Commit b1a4e6de authored by Thomas Juerges's avatar Thomas Juerges
Browse files

L2SS-245: do not use argparse and log more stuff

parent 425e605f
No related branches found
No related tags found
1 merge request!96L2SS-245: "Investigation monitoring load"
......@@ -16,19 +16,19 @@ 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 = 10
ARRAY_SIZE = 10000
POLLING_THREADS = 100
ARRAY_SIZE = 2000000
class Monitoring_Performance_Device(Device):
global ARRAY_SIZE
def read_array(self):
print("{} read_big".format(time.time()))
print("{} {} read_big".format(time.time(), self.get_name()))
return numpy.array([random.random(), ] * ARRAY_SIZE)
array1_r = attribute(
......@@ -110,18 +110,9 @@ class Monitoring_Performance_Device(Device):
def delete_device(self):
self.set_state(DevState.OFF)
0.0741395
def main(args = None, **kwargs):
global POLLING_THREADS, ARRAY_SIZE
POLLING_THREADS = 100
ARRAY_SIZE = 200000
# parser = ArgumentParser()
# 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)
# settings = parser.parse_known_args()
# POLLING_THREADS = settings[0].threads
# ARRAY_SIZE = settings[0].size
return run((Monitoring_Performance_Device, ), args = args, **kwargs)
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment