Skip to content

Commit

Permalink
Test CI for benchmark example and issue fixing
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Gil Aviles <[email protected]>
  • Loading branch information
Javgilavi committed Dec 11, 2024
1 parent d47e957 commit 54b8494
Show file tree
Hide file tree
Showing 11 changed files with 540 additions and 151 deletions.
8 changes: 3 additions & 5 deletions examples/cpp/benchmark/Benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef FAST_DDS_GENERATED__BENCHMARK_HPP
#define FAST_DDS_GENERATED__BENCHMARK_HPP

#include <cstdint>
#include <cstdint>
#include <utility>

#if defined(_WIN32)
Expand Down Expand Up @@ -78,7 +78,7 @@ class BenchMark
eProsima_user_DllExport BenchMark(
const BenchMark& x)
{
m_index = x.m_index;
m_index = x.m_index;

}

Expand All @@ -100,7 +100,7 @@ class BenchMark
const BenchMark& x)
{

m_index = x.m_index;
m_index = x.m_index;

return *this;
}
Expand Down Expand Up @@ -165,8 +165,6 @@ class BenchMark
return m_index;
}



private:

uint32_t m_index{0};
Expand Down
15 changes: 6 additions & 9 deletions examples/cpp/benchmark/Benchmark_big.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef FAST_DDS_GENERATED__BENCHMARK_BIG_HPP
#define FAST_DDS_GENERATED__BENCHMARK_BIG_HPP

#include <array>
#include <array>
#include <cstdint>
#include <utility>

Expand Down Expand Up @@ -79,9 +79,9 @@ class BenchMarkBig
eProsima_user_DllExport BenchMarkBig(
const BenchMarkBig& x)
{
m_data = x.m_data;
m_data = x.m_data;

m_index = x.m_index;
m_index = x.m_index;

}

Expand All @@ -104,9 +104,9 @@ class BenchMarkBig
const BenchMarkBig& x)
{

m_data = x.m_data;
m_data = x.m_data;

m_index = x.m_index;
m_index = x.m_index;

return *this;
}
Expand All @@ -132,7 +132,7 @@ class BenchMarkBig
const BenchMarkBig& x) const
{
return (m_data == x.m_data &&
m_index == x.m_index);
m_index == x.m_index);
}

/*!
Expand Down Expand Up @@ -183,7 +183,6 @@ class BenchMarkBig
return m_data;
}


/*!
* @brief This function sets a value in member index
* @param _index New value for member index
Expand Down Expand Up @@ -212,8 +211,6 @@ class BenchMarkBig
return m_index;
}



private:

std::array<char, 8388608> m_data{0};
Expand Down
15 changes: 6 additions & 9 deletions examples/cpp/benchmark/Benchmark_medium.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef FAST_DDS_GENERATED__BENCHMARK_MEDIUM_HPP
#define FAST_DDS_GENERATED__BENCHMARK_MEDIUM_HPP

#include <array>
#include <array>
#include <cstdint>
#include <utility>

Expand Down Expand Up @@ -79,9 +79,9 @@ class BenchMarkMedium
eProsima_user_DllExport BenchMarkMedium(
const BenchMarkMedium& x)
{
m_data = x.m_data;
m_data = x.m_data;

m_index = x.m_index;
m_index = x.m_index;

}

Expand All @@ -104,9 +104,9 @@ class BenchMarkMedium
const BenchMarkMedium& x)
{

m_data = x.m_data;
m_data = x.m_data;

m_index = x.m_index;
m_index = x.m_index;

return *this;
}
Expand All @@ -132,7 +132,7 @@ class BenchMarkMedium
const BenchMarkMedium& x) const
{
return (m_data == x.m_data &&
m_index == x.m_index);
m_index == x.m_index);
}

/*!
Expand Down Expand Up @@ -183,7 +183,6 @@ class BenchMarkMedium
return m_data;
}


/*!
* @brief This function sets a value in member index
* @param _index New value for member index
Expand Down Expand Up @@ -212,8 +211,6 @@ class BenchMarkMedium
return m_index;
}



private:

std::array<char, 524288> m_data{0};
Expand Down
15 changes: 6 additions & 9 deletions examples/cpp/benchmark/Benchmark_small.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef FAST_DDS_GENERATED__BENCHMARK_SMALL_HPP
#define FAST_DDS_GENERATED__BENCHMARK_SMALL_HPP

#include <array>
#include <array>
#include <cstdint>
#include <utility>

Expand Down Expand Up @@ -79,9 +79,9 @@ class BenchMarkSmall
eProsima_user_DllExport BenchMarkSmall(
const BenchMarkSmall& x)
{
m_array = x.m_array;
m_array = x.m_array;

m_index = x.m_index;
m_index = x.m_index;

}

Expand All @@ -104,9 +104,9 @@ class BenchMarkSmall
const BenchMarkSmall& x)
{

m_array = x.m_array;
m_array = x.m_array;

m_index = x.m_index;
m_index = x.m_index;

return *this;
}
Expand All @@ -132,7 +132,7 @@ class BenchMarkSmall
const BenchMarkSmall& x) const
{
return (m_array == x.m_array &&
m_index == x.m_index);
m_index == x.m_index);
}

/*!
Expand Down Expand Up @@ -183,7 +183,6 @@ class BenchMarkSmall
return m_array;
}


/*!
* @brief This function sets a value in member index
* @param _index New value for member index
Expand Down Expand Up @@ -212,8 +211,6 @@ class BenchMarkSmall
return m_index;
}



private:

std::array<char, 16384> m_array{0};
Expand Down
13 changes: 11 additions & 2 deletions examples/cpp/benchmark/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CLIParser
std::string topic_name = "benchmark_topic";
eprosima::fastdds::rtps::BuiltinTransports transport = eprosima::fastdds::rtps::BuiltinTransports::DEFAULT;
ReliabilityQosPolicyKind reliability = ReliabilityQosPolicyKind::BEST_EFFORT_RELIABILITY_QOS;
DurabilityQosPolicyKind durability = DurabilityQosPolicyKind::VOLATILE_DURABILITY_QOS;
};

public:
Expand Down Expand Up @@ -70,8 +71,8 @@ class CLIParser
struct publisher_config : public entity_config
{
uint16_t wait = 1000;
uint32_t interval = 100;
uint32_t end = 10000;
uint16_t interval = 100;
uint16_t end = 10000;
CLIParser::MsgSizeKind msg_size = CLIParser::MsgSizeKind::NONE;
};

Expand Down Expand Up @@ -113,6 +114,8 @@ class CLIParser
std::cout << " (Default: benchmark_topic)" << std::endl;
std::cout << " -r, --reliable Set Reliability QoS as reliable" << std::endl;
std::cout << " (Default: best effort)" << std::endl;
std::cout << " --transient-local Set Durability QoS as transient local" << std::endl;
std::cout << " (Default: volatile)" << std::endl;
std::cout << " -m <num>, --msg-size <num> Size of the message" << std::endl;
std::cout << " · NONE: Only an int value" << std::endl;
std::cout << " · SMALL: int value + array of 16Kb" << std::endl;
Expand Down Expand Up @@ -493,6 +496,12 @@ class CLIParser
print_help(EXIT_FAILURE);
}
}
else if (arg == "--transient-local")
{
config.pub_config.durability = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS;
config.sub_config.durability = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS;

}
else
{
EPROSIMA_LOG_ERROR(CLI_PARSER, "parsing argument: " + arg);
Expand Down
Loading

0 comments on commit 54b8494

Please sign in to comment.