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

L2SS-245: simplify filling of the arrays

parent 9b22b69b
No related branches found
No related tags found
1 merge request!96L2SS-245: "Investigation monitoring load"
...@@ -23,13 +23,23 @@ from time import time ...@@ -23,13 +23,23 @@ from time import time
__all__ = ["Monitoring_Performance_Device", "main"] __all__ = ["Monitoring_Performance_Device", "main"]
SMALL = 10000
BIG = 1000000
logger = logging.getLogger() logger = logging.getLogger()
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
def read(size): def read(size):
logger.info("read")
return numpy.array([random.random(), ] * size) return numpy.array([random.random(), ] * size)
def read_small():
logger.info("read_small")
return read(SMALL)
def read_big():
logger.info("read_big")
return read(BIG)
class Monitoring_Performance_Device(Device): class Monitoring_Performance_Device(Device):
small_array_r = attribute( small_array_r = attribute(
dtype = (numpy.double,), dtype = (numpy.double,),
...@@ -41,7 +51,7 @@ class Monitoring_Performance_Device(Device): ...@@ -41,7 +51,7 @@ class Monitoring_Performance_Device(Device):
archive_rel_change = 0.1, archive_rel_change = 0.1,
max_value = 1.0, max_value = 1.0,
min_value = 0.0, min_value = 0.0,
fget = read(10000), fget = read_small,
) )
big_array_r = attribute( big_array_r = attribute(
...@@ -53,7 +63,7 @@ class Monitoring_Performance_Device(Device): ...@@ -53,7 +63,7 @@ class Monitoring_Performance_Device(Device):
archive_rel_change = 0.1, archive_rel_change = 0.1,
max_value = 1.0, max_value = 1.0,
min_value = 0.0, min_value = 0.0,
fget = read(1000000), fget = read_big,
) )
def init_device(self): def init_device(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment