Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+41
-42
@@ -12,35 +12,34 @@
|
||||
namespace ComponentMonitor
|
||||
{
|
||||
|
||||
ComponentStatusHandler::ComponentStatusHandler()
|
||||
: QObject()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
ComponentStatusHandler::ComponentStatusHandler() : QObject(),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
ComponentStatusHandler::~ComponentStatusHandler()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_ddsHandler = nullptr;
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
bool ComponentStatusHandler::initialize(const std::shared_ptr<DdsHandler> &ddsHandler)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " START initialize ComponentStatusHandler";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " START initialize ComponentStatusHandler";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
m_ddsHandler = ddsHandler;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " ddsHandler referenced";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ddsHandler referenced";
|
||||
|
||||
m_ismDtc = m_ddsHandler->ismDtc();
|
||||
if (!m_ismDtc)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " Failure: no ismDtc";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure: no ismDtc";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,7 +47,7 @@ bool ComponentStatusHandler::initialize(const std::shared_ptr<DdsHandler> &ddsHa
|
||||
m_ismDtc->enableInstrumentationAsset();
|
||||
m_ismDtc->waitForHistoricalDataInstrumentationAsset(2000);
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " instrumentationAssets-size = " << m_ismDtc->instrumentationAssets().size();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " instrumentationAssets-size = " << m_ismDtc->instrumentationAssets().size();
|
||||
|
||||
|
||||
|
||||
@@ -65,8 +64,8 @@ bool ComponentStatusHandler::initialize(const std::shared_ptr<DdsHandler> &ddsHa
|
||||
QTimer::singleShot(35000, this, &ComponentStatusHandler::dump);
|
||||
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << "initialize succesful, statusMapSize=" << statusMapSize();
|
||||
INFO_LOG() << Q_FUNC_INFO << " END initialize ComponentStatusHandler, statusMapSize=" << statusMapSize();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "initialize succesful, statusMapSize=" << statusMapSize();
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " END initialize ComponentStatusHandler, statusMapSize=" << statusMapSize();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,7 +94,7 @@ void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureM
|
||||
static int assetChangedCounter = 0;
|
||||
|
||||
const int iAssetId = iAsset.id();
|
||||
DEBUG_LOG() << Q_FUNC_INFO
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< ", iAssetId=" << iAssetId
|
||||
<< " (assetChangedCounter=" << ++assetChangedCounter << ")";
|
||||
|
||||
@@ -139,62 +138,62 @@ void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureM
|
||||
|
||||
void ComponentStatusHandler::dump()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " DUMP START";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " DUMP START";
|
||||
|
||||
int counter = 0;
|
||||
|
||||
|
||||
counter = 0;
|
||||
DEBUG_LOG() << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG() << " REACHABLE:";
|
||||
DEBUG_LOG(m_logger) << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << " REACHABLE:";
|
||||
for (const ComponentStatus &status : std::as_const(m_statusMap))
|
||||
{
|
||||
if (status.state().underlying() == ComponentState_def::Reachable)
|
||||
{
|
||||
DEBUG_LOG() << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Reachable";
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Reachable";
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << " REACHABLE hostCounter = " << counter;
|
||||
DEBUG_LOG(m_logger) << " REACHABLE hostCounter = " << counter;
|
||||
|
||||
|
||||
counter = 0;
|
||||
DEBUG_LOG() << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG() << " UNREACHABLE:";
|
||||
DEBUG_LOG(m_logger) << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << " UNREACHABLE:";
|
||||
for (const ComponentStatus &status : std::as_const(m_statusMap))
|
||||
{
|
||||
if (status.state().underlying() == ComponentState_def::Unreachable)
|
||||
{
|
||||
DEBUG_LOG() << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Unreachable";
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Unreachable";
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << " UNREACHABLE hostCounter = " << counter;
|
||||
DEBUG_LOG(m_logger) << " UNREACHABLE hostCounter = " << counter;
|
||||
|
||||
|
||||
counter = 0;
|
||||
DEBUG_LOG() << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG() << " UNDEFINED:";
|
||||
DEBUG_LOG(m_logger) << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << " UNDEFINED:";
|
||||
for (const ComponentStatus &status : std::as_const(m_statusMap))
|
||||
{
|
||||
if (status.state().underlying() == ComponentState_def::Undefined)
|
||||
{
|
||||
DEBUG_LOG() << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Undefined";
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Undefined";
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << " UNDEFINED hostCounter = " << counter;
|
||||
DEBUG_LOG(m_logger) << " UNDEFINED hostCounter = " << counter;
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " DUMP END";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " DUMP END";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++";
|
||||
}
|
||||
|
||||
void ComponentStatusHandler::onNewState(const QString &hostname, bool reachable, long long lastCheckSec)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " hostname=" << hostname
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " hostname=" << hostname
|
||||
<< ", reachable=" << reachable
|
||||
<< ", lastCheckSec=" << lastCheckSec;
|
||||
|
||||
@@ -219,7 +218,7 @@ void ComponentStatusHandler::onNewState(const QString &hostname, bool reachable,
|
||||
|
||||
void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &hostnamesForUpdateLastCheckTime, qint64 lastCheckSec)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START hostnamesForLastCheckTime=" << hostnamesForUpdateLastCheckTime.join(QStringLiteral(";"));
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START hostnamesForLastCheckTime=" << hostnamesForUpdateLastCheckTime.join(QStringLiteral(";"));
|
||||
|
||||
for (ITERATOR_T it = m_statusMap.begin(); it != m_statusMap.end(); ++it)
|
||||
{
|
||||
@@ -236,12 +235,12 @@ void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &host
|
||||
if ((curState == ComponentState_def::Reachable) ||
|
||||
(curState == ComponentState_def::Unreachable))
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " updateLastCheckTimeDirect"
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updateLastCheckTimeDirect"
|
||||
<< " host: '" << curHostname << "'"
|
||||
<< " newLastCheck= " << lastCheckSec;
|
||||
INFO_LOG() << Q_FUNC_INFO << " DIFF_2a (*it) " << (*it);
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2a (*it) " << (*it);
|
||||
cs.last_check(lastCheckSec);
|
||||
INFO_LOG() << Q_FUNC_INFO << " DIFF_2b (*it) " << (*it);
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2b (*it) " << (*it);
|
||||
m_ddsHandler->dts()->publish(cs);
|
||||
}
|
||||
}
|
||||
@@ -250,7 +249,7 @@ void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &host
|
||||
bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandler::ITERATOR_T it,
|
||||
const ComponentStatus &cs)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START add/Update: cs=" << cs
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START add/Update: cs=" << cs
|
||||
<< ", curSize=" << m_statusMap.size() << ")";
|
||||
const int id = cs.id();
|
||||
|
||||
@@ -260,8 +259,8 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
|
||||
|
||||
if ((*it) != cs)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " DIFF (*it) " << (*it);
|
||||
INFO_LOG() << Q_FUNC_INFO << " DIFF cs " << cs;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF (*it) " << (*it);
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF cs " << cs;
|
||||
|
||||
(*it) = cs;
|
||||
m_ddsHandler->dts()->publish(cs);
|
||||
@@ -274,7 +273,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
|
||||
m_statusMap.insert(id, cs);
|
||||
m_ddsHandler->dts()->publish(cs);
|
||||
}
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " END add/Update: cs=" << cs
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END add/Update: cs=" << cs
|
||||
<< ", curSize=" << m_statusMap.size() << ")";
|
||||
return true;
|
||||
}
|
||||
@@ -282,7 +281,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
|
||||
bool ComponentStatusHandler::removeInstrumentationAsset(ComponentStatusHandler::ITERATOR_T it)
|
||||
{
|
||||
const int id = it.value().id();
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " remove: id=" << id;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " remove: id=" << id;
|
||||
m_statusMap.remove(id);
|
||||
m_ddsHandler->dts()->removeComponentStatusByKey(id);
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user