Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
b1c8c651
Commit
b1c8c651
authored
3 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-245
: simplify filling of the arrays
parent
9b22b69b
No related branches found
No related tags found
1 merge request
!96
L2SS-245: "Investigation monitoring load"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/test/devices/monitoring_performance_test.py
+13
-3
13 additions, 3 deletions
devices/test/devices/monitoring_performance_test.py
with
13 additions
and
3 deletions
devices/test/devices/monitoring_performance_test.py
+
13
−
3
View file @
b1c8c651
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment