Skip to content
Snippets Groups Projects
Commit f58f9fb7 authored by Joana Plewnia's avatar Joana Plewnia
Browse files

changed warning to debug/info and reduced spam if no maxHistorySize is set

parent 663298aa
No related branches found
No related tags found
1 merge request!467maxHistorySizeInfo reduced spamming
Pipeline #20659 failed
......@@ -27,7 +27,7 @@ namespace armarx::armem::server::segment
MemoryToIceAdapter& iceMemory,
const std::string& defaultCoreSegmentName = "",
aron::type::ObjectPtr coreSegmentAronType = nullptr,
int defaultMaxHistorySize = -1,
int defaultMaxHistorySize = 10,
const std::vector<PredictionEngine>& predictionEngines = {});
virtual ~SpecializedCoreSegment() override;
......
......@@ -29,7 +29,7 @@ namespace armarx::armem::server::segment
const std::string& defaultCoreSegmentName = "",
aron::type::ObjectPtr providerSegmentAronType = nullptr,
aron::type::ObjectPtr coreSegmentAronType = nullptr,
int defaultMaxHistorySize = -1,
int defaultMaxHistorySize = 10,
const std::vector<PredictionEngine>& providerSegmentPredictionEngines = {},
const std::vector<PredictionEngine>& coreSegmentPredictionEngines = {});
......
......@@ -5,11 +5,21 @@
namespace armarx::armem::server::wm::detail
{
void MaxHistorySize::setMaxHistorySize(long maxSize)
void MaxHistorySize::setMaxHistorySize(long maxSize, const std::string& additionalInfo)
{
if (maxSize < 0){
ARMARX_WARNING << "The maxHistorySize for this core segment is set to < 0. This means nothing will ever be forgotten in working memory. "
<< "This may slow down the memory server.";
if(additionalInfo != ""){
ARMARX_INFO << "The maxHistorySize for this memory entity is set to < 0. "
<< "This means nothing will ever be forgotten in working memory. "
<< "This may slow down the memory server."
<< "It is better to set the maxHistorySize per Provider- or CoreSegment";
} else {
ARMARX_DEBUG << "The maxHistorySize for this memory entity is set to < 0. "
<< "This means nothing will ever be forgotten in working memory. "
<< "This may slow down the memory server."
<< "The entity name is " << additionalInfo;
}
}
this->_maxHistorySize = maxSize;
}
......
......@@ -12,7 +12,7 @@ namespace armarx::armem::server::wm::detail
* @brief Set the maximum number of snapshots to be contained in an entity.
* Affected entities are to be update right away.
*/
void setMaxHistorySize(long maxSize);
void setMaxHistorySize(long maxSize, const std::string& additionalInfo = "");
long getMaxHistorySize() const;
......
......@@ -16,7 +16,8 @@ namespace armarx::armem::server::wm
void Entity::setMaxHistorySize(long maxSize)
{
MaxHistorySize::setMaxHistorySize(maxSize);
std::string containerID = (this->id()).str();
MaxHistorySize::setMaxHistorySize(maxSize, containerID);
truncate();
}
......
......@@ -101,7 +101,15 @@ namespace armarx::armem::server::wm
ProviderSegment& addProviderSegment(const std::string& name, Args... args)
{
ProviderSegmentT& added = CoreSegmentBase::addProviderSegment(name, args...);
added.setMaxHistorySize(this->getMaxHistorySize());
int maxHistorySize = this->getMaxHistorySize();
if(maxHistorySize < 0){
ARMARX_INFO << "The maxHistorySize for this core segment is set to < 0. "
<< "This means nothing will ever be forgotten in working memory. "
<< "This may slow down the memory server. \n"
<< "Core Segment Name: "
<< (this->id()).str();
}
added.setMaxHistorySize(maxHistorySize);
return added;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment