Bugfixes, additional output for delegations.

This commit is contained in:
Gunnar Beutner 2012-06-22 07:24:50 +02:00
parent 1d7a3f6c75
commit e8a44ad2fb
2 changed files with 23 additions and 3 deletions

View File

@ -142,9 +142,17 @@ void CheckerComponent::ResultTimerHandler(void)
Application::Log(LogWarning, "checker", latwarn.str());
}
stringstream msgbuf;
msgbuf << "ResultTimerHandler: " << results << " results (" << failed << " failed); latency: avg=" << avg_latency / (results ? results : 1) << ", min=" << min_latency << ", max: " << max_latency;
Application::Log(LogInformation, "checker", msgbuf.str());
{
stringstream msgbuf;
msgbuf << "ResultTimerHandler: " << results << " results (" << failed << " failed); latency: avg=" << avg_latency / (results ? results : 1) << ", min=" << min_latency << ", max: " << max_latency;
Application::Log(LogInformation, "checker", msgbuf.str());
}
{
stringstream msgbuf;
msgbuf << "Pending services: " << m_PendingServices.size() << "; idle services: " << m_Services.size();
Application::Log(LogInformation, "checker", msgbuf.str());
}
}
void CheckerComponent::AssignServiceRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request)

View File

@ -100,6 +100,11 @@ vector<Endpoint::Ptr> DelegationComponent::GetCheckerCandidates(const Service& s
for (it = GetEndpointManager()->Begin(); it != GetEndpointManager()->End(); it++) {
Endpoint::Ptr endpoint = it->second;
/* ignore disconnected endpoints */
if (!endpoint->IsConnected())
continue;
/* ignore endpoints that aren't running the checker component */
if (!endpoint->HasSubscription("checker::AssignService"))
continue;
@ -246,6 +251,13 @@ void DelegationComponent::DelegationTimerHandler(void)
AssignService(endpoint, *sit);
}
map<Endpoint::Ptr, int>::iterator hit;
for (hit = histogram.begin(); hit != histogram.end(); hit++) {
stringstream msgbuf;
msgbuf << "histogram: " << hit->first->GetIdentity() << " - " << hit->second;
Application::Log(LogInformation, "delegation", msgbuf.str());
}
}
stringstream msgbuf;