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
b325909e
Commit
b325909e
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-244
: Expose last received packet literally
parent
cec7ab37
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/Statistics.py
+1
-0
1 addition, 0 deletions
devices/Statistics.py
devices/clients/sst_client.py
+2
-0
2 additions, 0 deletions
devices/clients/sst_client.py
with
3 additions
and
0 deletions
devices/Statistics.py
+
1
−
0
View file @
b325909e
...
...
@@ -50,6 +50,7 @@ class Statistics(hardware_device):
# SST client annotation consists of a dict that contains the parameter name that needs to be read.
# Example: comms_annotation={"parameter": "this_value_R"}
nof_packets_R
=
attribute_wrapper
(
comms_annotation
=
{
"
parameter
"
:
"
nof_packets
"
},
datatype
=
numpy
.
uint64
)
last_packet_R
=
attribute_wrapper
(
comms_annotation
=
{
"
parameter
"
:
"
last_packet
"
},
dims
=
(
9000
,),
datatype
=
numpy
.
uint8
)
last_packet_timestamp_R
=
attribute_wrapper
(
comms_annotation
=
{
"
parameter
"
:
"
last_packet_timestamp
"
},
datatype
=
numpy
.
uint64
)
queue_fill_percentage_R
=
attribute_wrapper
(
comms_annotation
=
{
"
parameter
"
:
"
queue_fill_percentage
"
},
datatype
=
numpy
.
float32
)
...
...
This diff is collapsed.
Click to expand it.
devices/clients/sst_client.py
+
2
−
0
View file @
b325909e
...
...
@@ -159,6 +159,7 @@ class SST_collector(Thread):
self
.
parameters
=
{
"
nof_packets
"
:
numpy
.
uint64
(
0
),
"
last_packet
"
:
numpy
.
zeroes
((
9000
,),
dtype
=
numpy
.
uint8
),
"
last_packet_timestamp
"
:
numpy
.
uint64
(
0
),
"
queue_fill_percentage
"
:
numpy
.
float32
(
100
*
self
.
queue
.
qsize
()
/
self
.
queue
.
maxsize
if
self
.
queue
.
maxsize
else
0
),
...
...
@@ -199,6 +200,7 @@ class SST_collector(Thread):
def
process_packet
(
self
,
packet
):
self
.
parameters
[
"
nof_packets
"
]
+=
numpy
.
uint64
(
1
)
self
.
parameters
[
"
last_packet
"
][:
len
(
packet
)]
=
numpy
.
frombuffer
(
packet
,
dtype
=
numpy
.
uint8
)
self
.
parameters
[
"
last_packet_timestamp
"
]
=
numpy
.
uint64
(
int
(
time
.
time
()))
self
.
parameters
[
"
queue_fill_percentage
"
]
=
numpy
.
double
(
100
*
self
.
queue
.
qsize
()
/
self
.
queue
.
maxsize
if
self
.
queue
.
maxsize
else
0
)
...
...
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