Skip to content
GitLab
Explore
Sign in
Register
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
92a7b15b
Commit
92a7b15b
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-244
: Dont compute queue fill every second. Just compute on demand.
parent
3b971291
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
L2SS-244: Expose the SSTs in MPs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/SST.py
+1
-1
1 addition, 1 deletion
devices/SST.py
devices/clients/sst_client.py
+7
-9
7 additions, 9 deletions
devices/clients/sst_client.py
with
8 additions
and
10 deletions
devices/SST.py
+
1
−
1
View file @
92a7b15b
...
...
@@ -59,7 +59,7 @@ class SST(hardware_device):
# number of UDP packets that were processed
nof_packets_processed_R
=
attribute_wrapper
(
comms_annotation
=
{
"
type
"
:
"
sst
"
,
"
parameter
"
:
"
nof_packets
"
},
datatype
=
numpy
.
uint64
)
# queue fill percentage, as reported by the consumer
queue_fill_percentage_R
=
attribute
_wrapper
(
comms_annotation
=
{
"
type
"
:
"
sst
"
,
"
parameter
"
:
"
queue_fill_percentage
"
},
datatype
=
numpy
.
float32
)
queue_fill_percentage_R
=
attribute
(
dtype
=
numpy
.
float32
,
access
=
AttrWriteType
.
READ
,
fget
=
lambda
self
:
numpy
.
float32
(
self
.
sst_client
.
queue_fill_percentage
())
)
# number of invalid (non-SST) packets received
nof_invalid_packets_R
=
attribute_wrapper
(
comms_annotation
=
{
"
type
"
:
"
sst
"
,
"
parameter
"
:
"
nof_invalid_packets
"
},
datatype
=
numpy
.
uint64
)
...
...
This diff is collapsed.
Click to expand it.
devices/clients/sst_client.py
+
7
−
9
View file @
92a7b15b
...
...
@@ -45,6 +45,13 @@ class sst_client(CommClient):
fault_func
()
return
def
queue_fill_percentage
(
self
):
try
:
return
100
*
self
.
queue
.
qsize
()
/
self
.
queue
.
maxsize
if
self
.
queue
.
maxsize
else
0
except
NotImplementedError
:
# some platforms don't have qsize(), nothing we can do here
return
0
def
connect
(
self
):
"""
Function used to connect to the client.
...
...
@@ -217,7 +224,6 @@ class SST_collector(Thread):
self
.
parameters
=
{
"
nof_packets
"
:
numpy
.
uint64
(
0
),
"
queue_fill_percentage
"
:
numpy
.
float32
(
self
.
queue_fill_percentage
()),
# Packet count for packets that could not be parsed as SSTs
"
nof_invalid_packets
"
:
numpy
.
uint64
(
0
),
...
...
@@ -237,13 +243,6 @@ class SST_collector(Thread):
super
().
__init__
()
self
.
start
()
def
queue_fill_percentage
(
self
):
try
:
return
100
*
self
.
queue
.
qsize
()
/
self
.
queue
.
maxsize
if
self
.
queue
.
maxsize
else
0
except
NotImplementedError
:
# some platforms don't have qsize(), nothing we can do here
return
0
def
run
(
self
):
logging
.
info
(
"
Starting SST thread
"
)
...
...
@@ -277,7 +276,6 @@ class SST_collector(Thread):
def
process_packet
(
self
,
packet
):
self
.
parameters
[
"
nof_packets
"
]
+=
numpy
.
uint64
(
1
)
self
.
parameters
[
"
queue_fill_percentage
"
]
=
queue_fill_percentage
()
try
:
try
:
...
...
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