Skip to content

Commit 54b8494

Browse files
committed
Test CI for benchmark example and issue fixing
Signed-off-by: Javier Gil Aviles <[email protected]>
1 parent d47e957 commit 54b8494

11 files changed

+540
-151
lines changed

examples/cpp/benchmark/Benchmark.hpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef FAST_DDS_GENERATED__BENCHMARK_HPP
2323
#define FAST_DDS_GENERATED__BENCHMARK_HPP
2424

25-
#include <cstdint>
25+
#include <cstdint>
2626
#include <utility>
2727

2828
#if defined(_WIN32)
@@ -78,7 +78,7 @@ class BenchMark
7878
eProsima_user_DllExport BenchMark(
7979
const BenchMark& x)
8080
{
81-
m_index = x.m_index;
81+
m_index = x.m_index;
8282

8383
}
8484

@@ -100,7 +100,7 @@ class BenchMark
100100
const BenchMark& x)
101101
{
102102

103-
m_index = x.m_index;
103+
m_index = x.m_index;
104104

105105
return *this;
106106
}
@@ -165,8 +165,6 @@ class BenchMark
165165
return m_index;
166166
}
167167

168-
169-
170168
private:
171169

172170
uint32_t m_index{0};

examples/cpp/benchmark/Benchmark_big.hpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef FAST_DDS_GENERATED__BENCHMARK_BIG_HPP
2323
#define FAST_DDS_GENERATED__BENCHMARK_BIG_HPP
2424

25-
#include <array>
25+
#include <array>
2626
#include <cstdint>
2727
#include <utility>
2828

@@ -79,9 +79,9 @@ class BenchMarkBig
7979
eProsima_user_DllExport BenchMarkBig(
8080
const BenchMarkBig& x)
8181
{
82-
m_data = x.m_data;
82+
m_data = x.m_data;
8383

84-
m_index = x.m_index;
84+
m_index = x.m_index;
8585

8686
}
8787

@@ -104,9 +104,9 @@ class BenchMarkBig
104104
const BenchMarkBig& x)
105105
{
106106

107-
m_data = x.m_data;
107+
m_data = x.m_data;
108108

109-
m_index = x.m_index;
109+
m_index = x.m_index;
110110

111111
return *this;
112112
}
@@ -132,7 +132,7 @@ class BenchMarkBig
132132
const BenchMarkBig& x) const
133133
{
134134
return (m_data == x.m_data &&
135-
m_index == x.m_index);
135+
m_index == x.m_index);
136136
}
137137

138138
/*!
@@ -183,7 +183,6 @@ class BenchMarkBig
183183
return m_data;
184184
}
185185

186-
187186
/*!
188187
* @brief This function sets a value in member index
189188
* @param _index New value for member index
@@ -212,8 +211,6 @@ class BenchMarkBig
212211
return m_index;
213212
}
214213

215-
216-
217214
private:
218215

219216
std::array<char, 8388608> m_data{0};

examples/cpp/benchmark/Benchmark_medium.hpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef FAST_DDS_GENERATED__BENCHMARK_MEDIUM_HPP
2323
#define FAST_DDS_GENERATED__BENCHMARK_MEDIUM_HPP
2424

25-
#include <array>
25+
#include <array>
2626
#include <cstdint>
2727
#include <utility>
2828

@@ -79,9 +79,9 @@ class BenchMarkMedium
7979
eProsima_user_DllExport BenchMarkMedium(
8080
const BenchMarkMedium& x)
8181
{
82-
m_data = x.m_data;
82+
m_data = x.m_data;
8383

84-
m_index = x.m_index;
84+
m_index = x.m_index;
8585

8686
}
8787

@@ -104,9 +104,9 @@ class BenchMarkMedium
104104
const BenchMarkMedium& x)
105105
{
106106

107-
m_data = x.m_data;
107+
m_data = x.m_data;
108108

109-
m_index = x.m_index;
109+
m_index = x.m_index;
110110

111111
return *this;
112112
}
@@ -132,7 +132,7 @@ class BenchMarkMedium
132132
const BenchMarkMedium& x) const
133133
{
134134
return (m_data == x.m_data &&
135-
m_index == x.m_index);
135+
m_index == x.m_index);
136136
}
137137

138138
/*!
@@ -183,7 +183,6 @@ class BenchMarkMedium
183183
return m_data;
184184
}
185185

186-
187186
/*!
188187
* @brief This function sets a value in member index
189188
* @param _index New value for member index
@@ -212,8 +211,6 @@ class BenchMarkMedium
212211
return m_index;
213212
}
214213

215-
216-
217214
private:
218215

219216
std::array<char, 524288> m_data{0};

examples/cpp/benchmark/Benchmark_small.hpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef FAST_DDS_GENERATED__BENCHMARK_SMALL_HPP
2323
#define FAST_DDS_GENERATED__BENCHMARK_SMALL_HPP
2424

25-
#include <array>
25+
#include <array>
2626
#include <cstdint>
2727
#include <utility>
2828

@@ -79,9 +79,9 @@ class BenchMarkSmall
7979
eProsima_user_DllExport BenchMarkSmall(
8080
const BenchMarkSmall& x)
8181
{
82-
m_array = x.m_array;
82+
m_array = x.m_array;
8383

84-
m_index = x.m_index;
84+
m_index = x.m_index;
8585

8686
}
8787

@@ -104,9 +104,9 @@ class BenchMarkSmall
104104
const BenchMarkSmall& x)
105105
{
106106

107-
m_array = x.m_array;
107+
m_array = x.m_array;
108108

109-
m_index = x.m_index;
109+
m_index = x.m_index;
110110

111111
return *this;
112112
}
@@ -132,7 +132,7 @@ class BenchMarkSmall
132132
const BenchMarkSmall& x) const
133133
{
134134
return (m_array == x.m_array &&
135-
m_index == x.m_index);
135+
m_index == x.m_index);
136136
}
137137

138138
/*!
@@ -183,7 +183,6 @@ class BenchMarkSmall
183183
return m_array;
184184
}
185185

186-
187186
/*!
188187
* @brief This function sets a value in member index
189188
* @param _index New value for member index
@@ -212,8 +211,6 @@ class BenchMarkSmall
212211
return m_index;
213212
}
214213

215-
216-
217214
private:
218215

219216
std::array<char, 16384> m_array{0};

examples/cpp/benchmark/CLIParser.hpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class CLIParser
4242
std::string topic_name = "benchmark_topic";
4343
eprosima::fastdds::rtps::BuiltinTransports transport = eprosima::fastdds::rtps::BuiltinTransports::DEFAULT;
4444
ReliabilityQosPolicyKind reliability = ReliabilityQosPolicyKind::BEST_EFFORT_RELIABILITY_QOS;
45+
DurabilityQosPolicyKind durability = DurabilityQosPolicyKind::VOLATILE_DURABILITY_QOS;
4546
};
4647

4748
public:
@@ -70,8 +71,8 @@ class CLIParser
7071
struct publisher_config : public entity_config
7172
{
7273
uint16_t wait = 1000;
73-
uint32_t interval = 100;
74-
uint32_t end = 10000;
74+
uint16_t interval = 100;
75+
uint16_t end = 10000;
7576
CLIParser::MsgSizeKind msg_size = CLIParser::MsgSizeKind::NONE;
7677
};
7778

@@ -113,6 +114,8 @@ class CLIParser
113114
std::cout << " (Default: benchmark_topic)" << std::endl;
114115
std::cout << " -r, --reliable Set Reliability QoS as reliable" << std::endl;
115116
std::cout << " (Default: best effort)" << std::endl;
117+
std::cout << " --transient-local Set Durability QoS as transient local" << std::endl;
118+
std::cout << " (Default: volatile)" << std::endl;
116119
std::cout << " -m <num>, --msg-size <num> Size of the message" << std::endl;
117120
std::cout << " · NONE: Only an int value" << std::endl;
118121
std::cout << " · SMALL: int value + array of 16Kb" << std::endl;
@@ -493,6 +496,12 @@ class CLIParser
493496
print_help(EXIT_FAILURE);
494497
}
495498
}
499+
else if (arg == "--transient-local")
500+
{
501+
config.pub_config.durability = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS;
502+
config.sub_config.durability = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS;
503+
504+
}
496505
else
497506
{
498507
EPROSIMA_LOG_ERROR(CLI_PARSER, "parsing argument: " + arg);

0 commit comments

Comments
 (0)