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

L2SS-245: use a pre-created 0-value array to avoid latencies in the read function

parent b1a4e6de
No related branches found
No related tags found
1 merge request!96L2SS-245: "Investigation monitoring load"
......@@ -28,8 +28,8 @@ ARRAY_SIZE = 2000000
class Monitoring_Performance_Device(Device):
global ARRAY_SIZE
def read_array(self):
print("{} {} read_big".format(time.time(), self.get_name()))
return numpy.array([random.random(), ] * ARRAY_SIZE)
print("{} {}".format(time.time(), self.get_name()))
return self._array
array1_r = attribute(
dtype = (numpy.double,),
......@@ -90,6 +90,8 @@ class Monitoring_Performance_Device(Device):
self.set_state(DevState.OFF)
self._array = numpy.zeros(ARRAY_SIZE)
self.array1_r.set_data_ready_event(True)
self.set_change_event("array1_r", True, True)
self.set_archive_event("array1_r", True, True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment