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
3e9add26
Commit
3e9add26
authored
3 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-245
: add argparse so that I can start the thing with different settings
parent
fd302a22
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
+12
-1
12 additions, 1 deletion
devices/test/devices/monitoring_performance_test.py
with
12 additions
and
1 deletion
devices/test/devices/monitoring_performance_test.py
+
12
−
1
View file @
3e9add26
...
@@ -16,13 +16,14 @@ sys.path.append(parentdir)
...
@@ -16,13 +16,14 @@ sys.path.append(parentdir)
import
time
import
time
import
numpy
import
numpy
from
argparse
import
ArgumentParser
from
tango
import
DevState
,
Util
from
tango
import
DevState
,
Util
from
tango.server
import
run
,
Device
,
attribute
from
tango.server
import
run
,
Device
,
attribute
from
numpy
import
random
from
numpy
import
random
__all__
=
[
"
Monitoring_Performance_Device
"
,
"
main
"
]
__all__
=
[
"
Monitoring_Performance_Device
"
,
"
main
"
]
POLLING_THREADS
=
1
POLLING_THREADS
=
1
0
ARRAY_SIZE
=
10000
ARRAY_SIZE
=
10000
class
Monitoring_Performance_Device
(
Device
):
class
Monitoring_Performance_Device
(
Device
):
...
@@ -112,6 +113,16 @@ class Monitoring_Performance_Device(Device):
...
@@ -112,6 +113,16 @@ class Monitoring_Performance_Device(Device):
def
main
(
args
=
None
,
**
kwargs
):
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
)
return
run
((
Monitoring_Performance_Device
,
),
args
=
args
,
**
kwargs
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
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