Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advLigoRTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
CDS
software
advLigoRTS
Commits
d895b6b0
Commit
d895b6b0
authored
4 years ago
by
Jonathan Hanks
Browse files
Options
Downloads
Patches
Plain Diff
Adding {prefix}TOTAL_CRC_SUM to cps_recv.
parent
87ed6f6d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!170
Cps recv to get dc diags
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/pub_sub_stream/dc_stats.cc
+24
-0
24 additions, 0 deletions
src/pub_sub_stream/dc_stats.cc
src/pub_sub_stream/dc_stats.hh
+12
-0
12 additions, 0 deletions
src/pub_sub_stream/dc_stats.hh
src/pub_sub_stream/tests/test_dc_stats.cc
+3
-0
3 additions, 0 deletions
src/pub_sub_stream/tests/test_dc_stats.cc
with
39 additions
and
0 deletions
src/pub_sub_stream/dc_stats.cc
+
24
−
0
View file @
d895b6b0
...
@@ -356,6 +356,15 @@ DCStats::DCStats( std::vector< SimplePV >& pvs,
...
@@ -356,6 +356,15 @@ DCStats::DCStats( std::vector< SimplePV >& pvs,
std
::
numeric_limits
<
int
>::
max
(
),
std
::
numeric_limits
<
int
>::
max
(
),
-
1
,
-
1
,
}
);
}
);
pvs
.
emplace_back
(
SimplePV
{
"TOTAL_CRC_SUM"
,
SIMPLE_PV_INT
,
reinterpret_cast
<
void
*
>
(
&
total_crc_count_
),
1
,
1
,
-
1
,
-
1
,
}
);
valid_
=
true
;
valid_
=
true
;
}
}
...
@@ -574,6 +583,12 @@ entry_was_processed( DCUStats& cur )
...
@@ -574,6 +583,12 @@ entry_was_processed( DCUStats& cur )
return
cur
.
processed
;
return
cur
.
processed
;
}
}
static
std
::
int64_t
total_crc_sum
(
std
::
int64_t
val
,
const
DCUStats
&
cur
)
{
return
val
+
static_cast
<
std
::
int64_t
>
(
cur
.
crc_sum
);
}
dc_queue
::
value_type
dc_queue
::
value_type
DCStats
::
get_message
(
simple_pv_handle
epics_server
)
DCStats
::
get_message
(
simple_pv_handle
epics_server
)
{
{
...
@@ -602,6 +617,7 @@ DCStats::run( simple_pv_handle epics_server )
...
@@ -602,6 +617,7 @@ DCStats::run( simple_pv_handle epics_server )
std
::
vector
<
dcuid_crc_pair
>
data_block_crcs
;
std
::
vector
<
dcuid_crc_pair
>
data_block_crcs
;
data_block_crcs
.
reserve
(
DCU_COUNT
);
data_block_crcs
.
reserve
(
DCU_COUNT
);
int
prev_total_crc_count
{
0
};
std
::
uint64_t
tp_data
{
0
};
std
::
uint64_t
tp_data
{
0
};
std
::
uint64_t
model_data
{
0
};
std
::
uint64_t
model_data
{
0
};
std
::
uint64_t
total_data
{
0
};
std
::
uint64_t
total_data
{
0
};
...
@@ -694,6 +710,13 @@ DCStats::run( simple_pv_handle epics_server )
...
@@ -694,6 +710,13 @@ DCStats::run( simple_pv_handle epics_server )
for_each
(
dcu_status_
,
mark_dcu_if_skipped_this_cycle
);
for_each
(
dcu_status_
,
mark_dcu_if_skipped_this_cycle
);
for_each
(
dcu_status_
,
clear_seen_last_cycle_if_skipped
);
for_each
(
dcu_status_
,
clear_seen_last_cycle_if_skipped
);
uint64_t
crc_sum
=
boost
::
accumulate
(
dcu_status_
,
0
,
total_crc_sum
);
if
(
crc_sum
>
prev_total_crc_count
)
{
total_crc_count_
+=
crc_sum
-
prev_total_crc_count
;
}
prev_total_crc_count
=
crc_sum
;
bool
alternating_cycle
=
cycles
%
2
==
0
;
bool
alternating_cycle
=
cycles
%
2
==
0
;
bool
one_sec_update
=
cycles
%
16
==
0
;
bool
one_sec_update
=
cycles
%
16
==
0
;
...
@@ -739,6 +762,7 @@ DCStats::run( simple_pv_handle epics_server )
...
@@ -739,6 +762,7 @@ DCStats::run( simple_pv_handle epics_server )
{
{
for_each
(
dcu_status_
,
clear_crc
);
for_each
(
dcu_status_
,
clear_crc
);
request_clear_crc_
=
false
;
request_clear_crc_
=
false
;
prev_total_crc_count
=
0
;
}
}
}
}
else
if
(
alternating_cycle
)
else
if
(
alternating_cycle
)
...
...
This diff is collapsed.
Click to expand it.
src/pub_sub_stream/dc_stats.hh
+
12
−
0
View file @
d895b6b0
...
@@ -108,6 +108,17 @@ public:
...
@@ -108,6 +108,17 @@ public:
return
dcu_status_
[
dcuid
];
return
dcu_status_
[
dcuid
];
}
}
/*!
* @brief Return the total crc count for the system, a debugging/testing
* aid.
* @return the sum of the crc count for the lifetime of this object.
*/
int
get_total_crcs
(
)
const
{
return
total_crc_count_
;
}
/*!
/*!
* @brief get a readonly reference to the channel list
* @brief get a readonly reference to the channel list
* @return the channel list
* @return the channel list
...
@@ -145,6 +156,7 @@ private:
...
@@ -145,6 +156,7 @@ private:
unsigned
int
tp_data_kb_per_s_
{
0
};
unsigned
int
tp_data_kb_per_s_
{
0
};
unsigned
int
model_data_kb_per_s_
{
0
};
unsigned
int
model_data_kb_per_s_
{
0
};
unsigned
int
total_data_kb_per_s_
{
0
};
unsigned
int
total_data_kb_per_s_
{
0
};
int
total_crc_count_
{
0
};
std
::
atomic
<
bool
>
request_clear_crc_
{
false
};
std
::
atomic
<
bool
>
request_clear_crc_
{
false
};
std
::
atomic
<
bool
>
request_stop_
{
false
};
std
::
atomic
<
bool
>
request_stop_
{
false
};
...
...
This diff is collapsed.
Click to expand it.
src/pub_sub_stream/tests/test_dc_stats.cc
+
3
−
0
View file @
d895b6b0
...
@@ -142,6 +142,7 @@ TEST_CASE(
...
@@ -142,6 +142,7 @@ TEST_CASE(
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
processed
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
processed
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
crc_sum
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
crc_sum
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
status
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
status
==
0
);
REQUIRE
(
dc_stats
.
get_total_crcs
(
)
==
0
);
{
{
auto
data
=
make_unique_ptr
<
daq_dc_data_t
>
(
);
auto
data
=
make_unique_ptr
<
daq_dc_data_t
>
(
);
memset
(
memset
(
...
@@ -158,6 +159,7 @@ TEST_CASE(
...
@@ -158,6 +159,7 @@ TEST_CASE(
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
processed
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
processed
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
crc_sum
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
crc_sum
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
status
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
status
==
0
);
REQUIRE
(
dc_stats
.
get_total_crcs
(
)
==
1
);
{
{
auto
data
=
make_unique_ptr
<
daq_dc_data_t
>
(
);
auto
data
=
make_unique_ptr
<
daq_dc_data_t
>
(
);
memset
(
memset
(
...
@@ -174,6 +176,7 @@ TEST_CASE(
...
@@ -174,6 +176,7 @@ TEST_CASE(
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
processed
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
processed
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
crc_sum
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
crc_sum
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
status
==
0
);
REQUIRE
(
dc_stats
.
peek_stats
(
2
).
status
==
0
);
REQUIRE
(
dc_stats
.
get_total_crcs
(
)
==
1
);
dc_stats
.
stop
(
);
dc_stats
.
stop
(
);
th
.
join
(
);
th
.
join
(
);
...
...
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