Skip to content

Commit 7219e6b

Browse files
cferreiragonzMiguelCompany
authored andcommitted
Improve latency tests (#5998)
* Refs #23482: Remove Log filter Signed-off-by: cferreiragonz <[email protected]> * Refs #23482: Fix destruction of latency tests Signed-off-by: cferreiragonz <[email protected]> * Refs #23482: Make reliable tests keep_all with allocated resources Signed-off-by: cferreiragonz <[email protected]> Use keep_all history Signed-off-by: cferreiragonz <[email protected]> Alloc resources Signed-off-by: cferreiragonz <[email protected]> * Refs #23482: Apply changes to udp too Signed-off-by: cferreiragonz <[email protected]> --------- Signed-off-by: cferreiragonz <[email protected]> (cherry picked from commit b39ed87)
1 parent c460edf commit 7219e6b

File tree

6 files changed

+112
-58
lines changed

6 files changed

+112
-58
lines changed

test/performance/latency/LatencyTestPublisher.cpp

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ LatencyTestPublisher::LatencyTestPublisher()
5757

5858
LatencyTestPublisher::~LatencyTestPublisher()
5959
{
60-
std::string TestCommandType("TestCommandType");
61-
participant_->unregister_type(TestCommandType);
62-
63-
DomainParticipantFactory::get_instance()->delete_participant(participant_);
64-
6560
EPROSIMA_LOG_INFO(LatencyTest, "Pub: Participant removed");
6661
}
6762

@@ -661,28 +656,11 @@ void LatencyTestPublisher::run()
661656

662657
void LatencyTestPublisher::destroy_user_entities()
663658
{
664-
// Static type endpoints should have been removed for each payload iteration
665-
if (dynamic_types_)
666-
{
667-
destroy_data_endpoints();
668-
}
669-
else if (nullptr != data_writer_
670-
|| nullptr != data_reader_
671-
|| nullptr != latency_data_pub_topic_
672-
|| nullptr != latency_data_sub_topic_
673-
|| !latency_data_type_)
674-
{
675-
EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unregistering the DATA type and/or removing the endpoints");
676-
}
677-
678-
subscriber_->delete_datareader(command_reader_);
679-
participant_->delete_subscriber(subscriber_);
659+
// Delete DDS entities contained within the DomainParticipant
660+
participant_->delete_contained_entities();
680661

681-
publisher_->delete_datawriter(command_writer_);
682-
participant_->delete_publisher(publisher_);
683-
684-
participant_->delete_topic(latency_command_sub_topic_);
685-
participant_->delete_topic(latency_command_pub_topic_);
662+
// Delete DomainParticipant
663+
DomainParticipantFactory::get_instance()->delete_participant(participant_);
686664
}
687665

688666
void LatencyTestPublisher::export_csv(

test/performance/latency/LatencyTestSubscriber.cpp

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ LatencyTestSubscriber::LatencyTestSubscriber()
5151

5252
LatencyTestSubscriber::~LatencyTestSubscriber()
5353
{
54-
std::string TestCommandType("TestCommandType");
55-
participant_->unregister_type(TestCommandType);
56-
57-
DomainParticipantFactory::get_instance()->delete_participant(participant_);
58-
5954
EPROSIMA_LOG_INFO(LatencyTest, "Sub: Participant removed");
6055
}
6156

@@ -620,28 +615,11 @@ void LatencyTestSubscriber::run()
620615

621616
void LatencyTestSubscriber::destroy_user_entities()
622617
{
623-
// Static type endpoints should have been remove for each payload iteration
624-
if (dynamic_types_)
625-
{
626-
destroy_data_endpoints();
627-
}
628-
else if (nullptr != data_writer_
629-
|| nullptr != data_reader_
630-
|| nullptr != latency_data_pub_topic_
631-
|| nullptr != latency_data_sub_topic_
632-
|| !latency_data_type_)
633-
{
634-
EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR unregistering the DATA type and/or removing the endpoints");
635-
}
636-
637-
subscriber_->delete_datareader(command_reader_);
638-
participant_->delete_subscriber(subscriber_);
618+
// Delete DDS entities contained within the DomainParticipant
619+
participant_->delete_contained_entities();
639620

640-
publisher_->delete_datawriter(command_writer_);
641-
participant_->delete_publisher(publisher_);
642-
643-
participant_->delete_topic(latency_command_sub_topic_);
644-
participant_->delete_topic(latency_command_pub_topic_);
621+
// Delete DomainParticipant
622+
DomainParticipantFactory::get_instance()->delete_participant(participant_);
645623
}
646624

647625
bool LatencyTestSubscriber::test(

test/performance/latency/main_LatencyTest.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
2424
#include <fastdds/dds/log/Colors.hpp>
25-
#include <fastdds/dds/log/Log.hpp>
2625

2726
#include "../optionarg.hpp"
2827
#include "LatencyTestPublisher.hpp"
@@ -185,11 +184,6 @@ int main(
185184
int argc,
186185
char** argv)
187186
{
188-
189-
using Log = eprosima::fastdds::dds::Log;
190-
Log::SetVerbosity(Log::Kind::Info);
191-
Log::SetCategoryFilter(std::regex("LatencyTest"));
192-
193187
int columns;
194188

195189
#if defined(_WIN32)

test/performance/latency/xml/latency_interprocess_reliable_shm_profile.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
</rtps>
2020
</participant>
2121
<data_writer profile_name="pub_publisher_profile">
22+
<topic>
23+
<historyQos>
24+
<kind>KEEP_ALL</kind>
25+
</historyQos>
26+
<resourceLimitsQos>
27+
<max_samples>11000</max_samples>
28+
<max_samples_per_instance>11000</max_samples_per_instance>
29+
<allocated_samples>11000</allocated_samples>
30+
</resourceLimitsQos>
31+
</topic>
2232
<qos>
2333
<reliability>
2434
<kind>RELIABLE</kind>
@@ -32,6 +42,16 @@
3242
</qos>
3343
</data_writer>
3444
<data_reader profile_name="pub_subscriber_profile">
45+
<topic>
46+
<historyQos>
47+
<kind>KEEP_ALL</kind>
48+
</historyQos>
49+
<resourceLimitsQos>
50+
<max_samples>11000</max_samples>
51+
<max_samples_per_instance>11000</max_samples_per_instance>
52+
<allocated_samples>11000</allocated_samples>
53+
</resourceLimitsQos>
54+
</topic>
3555
<qos>
3656
<reliability>
3757
<kind>RELIABLE</kind>
@@ -63,6 +83,16 @@
6383
</rtps>
6484
</participant>
6585
<data_writer profile_name="sub_publisher_profile">
86+
<topic>
87+
<historyQos>
88+
<kind>KEEP_ALL</kind>
89+
</historyQos>
90+
<resourceLimitsQos>
91+
<max_samples>11000</max_samples>
92+
<max_samples_per_instance>11000</max_samples_per_instance>
93+
<allocated_samples>11000</allocated_samples>
94+
</resourceLimitsQos>
95+
</topic>
6696
<qos>
6797
<reliability>
6898
<kind>RELIABLE</kind>
@@ -76,6 +106,16 @@
76106
</qos>
77107
</data_writer>
78108
<data_reader profile_name="sub_subscriber_profile">
109+
<topic>
110+
<historyQos>
111+
<kind>KEEP_ALL</kind>
112+
</historyQos>
113+
<resourceLimitsQos>
114+
<max_samples>11000</max_samples>
115+
<max_samples_per_instance>11000</max_samples_per_instance>
116+
<allocated_samples>11000</allocated_samples>
117+
</resourceLimitsQos>
118+
</topic>
79119
<qos>
80120
<reliability>
81121
<kind>RELIABLE</kind>

test/performance/latency/xml/latency_interprocess_reliable_udp_profile.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
</rtps>
2323
</participant>
2424
<data_writer profile_name="pub_publisher_profile">
25+
<topic>
26+
<historyQos>
27+
<kind>KEEP_ALL</kind>
28+
</historyQos>
29+
<resourceLimitsQos>
30+
<max_samples>11000</max_samples>
31+
<max_samples_per_instance>11000</max_samples_per_instance>
32+
<allocated_samples>11000</allocated_samples>
33+
</resourceLimitsQos>
34+
</topic>
2535
<qos>
2636
<reliability>
2737
<kind>RELIABLE</kind>
@@ -35,6 +45,16 @@
3545
</qos>
3646
</data_writer>
3747
<data_reader profile_name="pub_subscriber_profile">
48+
<topic>
49+
<historyQos>
50+
<kind>KEEP_ALL</kind>
51+
</historyQos>
52+
<resourceLimitsQos>
53+
<max_samples>11000</max_samples>
54+
<max_samples_per_instance>11000</max_samples_per_instance>
55+
<allocated_samples>11000</allocated_samples>
56+
</resourceLimitsQos>
57+
</topic>
3858
<qos>
3959
<reliability>
4060
<kind>RELIABLE</kind>
@@ -60,6 +80,16 @@
6080
</rtps>
6181
</participant>
6282
<data_writer profile_name="sub_publisher_profile">
83+
<topic>
84+
<historyQos>
85+
<kind>KEEP_ALL</kind>
86+
</historyQos>
87+
<resourceLimitsQos>
88+
<max_samples>11000</max_samples>
89+
<max_samples_per_instance>11000</max_samples_per_instance>
90+
<allocated_samples>11000</allocated_samples>
91+
</resourceLimitsQos>
92+
</topic>
6393
<qos>
6494
<reliability>
6595
<kind>RELIABLE</kind>
@@ -73,6 +103,16 @@
73103
</qos>
74104
</data_writer>
75105
<data_reader profile_name="sub_subscriber_profile">
106+
<topic>
107+
<historyQos>
108+
<kind>KEEP_ALL</kind>
109+
</historyQos>
110+
<resourceLimitsQos>
111+
<max_samples>11000</max_samples>
112+
<max_samples_per_instance>11000</max_samples_per_instance>
113+
<allocated_samples>11000</allocated_samples>
114+
</resourceLimitsQos>
115+
</topic>
76116
<qos>
77117
<reliability>
78118
<kind>RELIABLE</kind>

test/performance/latency/xml/latency_intraprocess_reliable_profile.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
</rtps>
2424
</participant>
2525
<data_writer profile_name="pub_publisher_profile">
26+
<topic>
27+
<historyQos>
28+
<kind>KEEP_LAST</kind>
29+
<depth>2500</depth>
30+
</historyQos>
31+
</topic>
2632
<qos>
2733
<reliability>
2834
<kind>RELIABLE</kind>
@@ -36,6 +42,12 @@
3642
</qos>
3743
</data_writer>
3844
<data_reader profile_name="pub_subscriber_profile">
45+
<topic>
46+
<historyQos>
47+
<kind>KEEP_LAST</kind>
48+
<depth>2500</depth>
49+
</historyQos>
50+
</topic>
3951
<qos>
4052
<reliability>
4153
<kind>RELIABLE</kind>
@@ -71,6 +83,12 @@
7183
</rtps>
7284
</participant>
7385
<data_writer profile_name="sub_publisher_profile">
86+
<topic>
87+
<historyQos>
88+
<kind>KEEP_LAST</kind>
89+
<depth>2500</depth>
90+
</historyQos>
91+
</topic>
7492
<qos>
7593
<reliability>
7694
<kind>RELIABLE</kind>
@@ -84,6 +102,12 @@
84102
</qos>
85103
</data_writer>
86104
<data_reader profile_name="sub_subscriber_profile">
105+
<topic>
106+
<historyQos>
107+
<kind>KEEP_LAST</kind>
108+
<depth>2500</depth>
109+
</historyQos>
110+
</topic>
87111
<qos>
88112
<reliability>
89113
<kind>RELIABLE</kind>

0 commit comments

Comments
 (0)