Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ddressed several minor issues.
  • Loading branch information
MiguelCompany committed Jun 6, 2018
1 parent 6741608 commit e4f0db6
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/C++/HelloWorldExample/HelloWorldSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ void HelloWorldSubscriber::run()
void HelloWorldSubscriber::run(uint32_t number)
{
std::cout << "Subscriber running until "<< number << "samples have been received"<<std::endl;
while(number < this->m_listener.n_samples)
while(number > this->m_listener.n_samples)
eClock::my_sleep(500);
}
6 changes: 0 additions & 6 deletions src/cpp/publisher/PublisherImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ class PublisherImpl
*/
bool removeAllChange(size_t* removed);

/**
* Get the number of elements in the History.
* @return Number of elements in the History.
*/
size_t getHistoryElementsNumber();

/**
*
* @return
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/rtps/history/CacheChangePool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ CacheChangePool::~CacheChangePool()

CacheChangePool::CacheChangePool(int32_t pool_size, uint32_t payload_size, int32_t max_pool_size, MemoryManagementPolicy_t memoryPolicy) : mp_mutex(new std::mutex()), memoryMode(memoryPolicy)
{
std::lock_guard<std::mutex> guard(*this->mp_mutex);

//Common for all modes: Set the payload size (maximum allowed), size and size limit
++pool_size;
logInfo(RTPS_UTILS,"Creating CacheChangePool of size: "<< pool_size << " with payload of size: " << payload_size);
Expand Down
4 changes: 2 additions & 2 deletions test/performance/LatencyTestPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ bool LatencyTestPublisher::test(uint32_t datasize)
size_t removed=0;
mp_datapub->removeAllChange(&removed);
//cout << " REMOVED: "<< removed<<endl;
analizeTimes(datasize);
analyzeTimes(datasize);
printStat(m_stats.back());

delete(mp_latency_in);
Expand All @@ -584,7 +584,7 @@ bool LatencyTestPublisher::test(uint32_t datasize)
return true;
}

void LatencyTestPublisher::analizeTimes(uint32_t datasize)
void LatencyTestPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand Down
2 changes: 1 addition & 1 deletion test/performance/LatencyTestPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class LatencyTestPublisher {
const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy,
const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, bool large_data);
void run();
void analizeTimes(uint32_t datasize);
void analyzeTimes(uint32_t datasize);
bool test(uint32_t datasize);
void printStat(TimeStats& TS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ bool LatencyTestPublisher::test(uint32_t datasize)
size_t removed=0;
mp_datapub->removeAllChange(&removed);
// cout << "REMOVED: "<< removed<<endl;
analizeTimes(datasize);
analyzeTimes(datasize);
printStat(m_stats.back());
// delete(mp_latency_in);
// delete(mp_latency_out);
return true;
}

#if defined(_WIN32)
void LatencyTestPublisher::analizeTimes(uint32_t datasize)
void LatencyTestPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand All @@ -363,7 +363,7 @@ void LatencyTestPublisher::printStat(TimeStats& TS)
TS.max);
}
#else
void LatencyTestPublisher::analizeTimes(uint32_t datasize)
void LatencyTestPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class LatencyTestPublisher {
int n_received;
bool init(int n_sub,int n_sam);
void run();
void analizeTimes(uint32_t datasize);
void analyzeTimes(uint32_t datasize);
bool test(uint32_t datasize);
void printStat(TimeStats& TS);
class DataPubListener : public PublisherListener
Expand Down
8 changes: 4 additions & 4 deletions utils/outdatedTests/ZeroMQTest/ZeroMQPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ bool ZeroMQPublisher::test(uint32_t datasize)
m_clock.setTimeNow(&m_t2);
m_times.push_back(TimeConv::Time_t2MicroSecondsDouble(m_t2)
-TimeConv::Time_t2MicroSecondsDouble(m_t1)-m_overhead);
analizeTimes(datasize);
analyzeTimes(datasize);
printStat(m_stats.back());

return true;
}


void ZeroMQPublisher::analizeTimes(uint32_t datasize)
void ZeroMQPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand Down Expand Up @@ -203,12 +203,12 @@ bool ZeroMQPublisher::test(uint32_t datasize)
-TimeConv::Time_t2MicroSecondsDouble(m_t1)-m_overhead);

}
analizeTimes(datasize);
analyzeTimes(datasize);
printStat(m_stats.back());

return true;
}
void ZeroMQPublisher::analizeTimes(uint32_t datasize)
void ZeroMQPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand Down
2 changes: 1 addition & 1 deletion utils/outdatedTests/ZeroMQTest/ZeroMQPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ZeroMQPublisher {
virtual ~ZeroMQPublisher();
bool init(string ip,int n_samples=1000);
void run();
void analizeTimes(uint32_t datasize);
void analyzeTimes(uint32_t datasize);
bool test(uint32_t datasize);
void printStat(TimeStats& TS);
std::vector<double> m_times;
Expand Down
8 changes: 4 additions & 4 deletions utils/pcTests/ZMQTests/LatencyZMQ/ZeroMQPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ bool ZeroMQPublisher::test(uint32_t datasize)
m_clock.setTimeNow(&m_t2);
m_times.push_back(TimeConv::Time_t2MicroSecondsDouble(m_t2)
-TimeConv::Time_t2MicroSecondsDouble(m_t1)-m_overhead);
analizeTimes(datasize);
analyzeTimes(datasize);
printStat(m_stats.back());

return true;
}


void ZeroMQPublisher::analizeTimes(uint32_t datasize)
void ZeroMQPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand Down Expand Up @@ -214,12 +214,12 @@ bool ZeroMQPublisher::test(uint32_t datasize)
m_times.push_back(time);

}
analizeTimes(datasize);
analyzeTimes(datasize);
printStat(m_stats.back());

return true;
}
void ZeroMQPublisher::analizeTimes(uint32_t datasize)
void ZeroMQPublisher::analyzeTimes(uint32_t datasize)
{
TimeStats TS;
TS.nbytes = datasize+4;
Expand Down
2 changes: 1 addition & 1 deletion utils/pcTests/ZMQTests/LatencyZMQ/ZeroMQPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ZeroMQPublisher {
virtual ~ZeroMQPublisher();
bool init(std::vector<std::string>subIP,int n_samples=1000);
void run();
void analizeTimes(uint32_t datasize);
void analyzeTimes(uint32_t datasize);
bool test(uint32_t datasize);
void printStat(TimeStats& TS);
std::vector<double> m_times;
Expand Down

0 comments on commit e4f0db6

Please sign in to comment.