Skip to content

Commit 1c00e16

Browse files
committed
Improve latency tests (#5998)
* Refs #23482: Remove Log filter Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #23482: Fix destruction of latency tests Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #23482: Make reliable tests keep_all with allocated resources Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> Use keep_all history Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> Alloc resources Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #23482: Apply changes to udp too Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> (cherry picked from commit b39ed87)
1 parent 34f95aa commit 1c00e16

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

@@ -689,28 +684,11 @@ void LatencyTestPublisher::run()
689684

690685
void LatencyTestPublisher::destroy_user_entities()
691686
{
692-
// Static type endpoints should have been removed for each payload iteration
693-
if (dynamic_types_)
694-
{
695-
destroy_data_endpoints();
696-
}
697-
else if (nullptr != data_writer_
698-
|| nullptr != data_reader_
699-
|| nullptr != latency_data_pub_topic_
700-
|| nullptr != latency_data_sub_topic_
701-
|| !latency_data_type_)
702-
{
703-
EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unregistering the DATA type and/or removing the endpoints");
704-
}
705-
706-
subscriber_->delete_datareader(command_reader_);
707-
participant_->delete_subscriber(subscriber_);
687+
// Delete DDS entities contained within the DomainParticipant
688+
participant_->delete_contained_entities();
708689

709-
publisher_->delete_datawriter(command_writer_);
710-
participant_->delete_publisher(publisher_);
711-
712-
participant_->delete_topic(latency_command_sub_topic_);
713-
participant_->delete_topic(latency_command_pub_topic_);
690+
// Delete DomainParticipant
691+
DomainParticipantFactory::get_instance()->delete_participant(participant_);
714692
}
715693

716694
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

@@ -642,28 +637,11 @@ void LatencyTestSubscriber::run()
642637

643638
void LatencyTestSubscriber::destroy_user_entities()
644639
{
645-
// Static type endpoints should have been remove for each payload iteration
646-
if (dynamic_types_)
647-
{
648-
destroy_data_endpoints();
649-
}
650-
else if (nullptr != data_writer_
651-
|| nullptr != data_reader_
652-
|| nullptr != latency_data_pub_topic_
653-
|| nullptr != latency_data_sub_topic_
654-
|| !latency_data_type_)
655-
{
656-
EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR unregistering the DATA type and/or removing the endpoints");
657-
}
658-
659-
subscriber_->delete_datareader(command_reader_);
660-
participant_->delete_subscriber(subscriber_);
640+
// Delete DDS entities contained within the DomainParticipant
641+
participant_->delete_contained_entities();
661642

662-
publisher_->delete_datawriter(command_writer_);
663-
participant_->delete_publisher(publisher_);
664-
665-
participant_->delete_topic(latency_command_sub_topic_);
666-
participant_->delete_topic(latency_command_pub_topic_);
643+
// Delete DomainParticipant
644+
DomainParticipantFactory::get_instance()->delete_participant(participant_);
667645
}
668646

669647
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/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/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/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)