From e3bf2960fa86b9880189e86f74e8fc4b29242103 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 17 Oct 2013 09:28:49 +0200 Subject: [PATCH] cluster: Add debug message. --- components/cluster/clusterlistener.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/components/cluster/clusterlistener.cpp b/components/cluster/clusterlistener.cpp index 670cf1c0f..5baea767a 100644 --- a/components/cluster/clusterlistener.cpp +++ b/components/cluster/clusterlistener.cpp @@ -1541,12 +1541,27 @@ void ClusterListener::UpdateAuthority(void) { Log(LogDebug, "cluster", "Updating authority for objects."); + int checker_count = 0, notifications_count = 0; + BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) { BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) { - object->SetAuthority("checker", IsAuthority(object, "checker")); - object->SetAuthority("notifications", IsAuthority(object, "notifications")); + bool checkerAuthority = IsAuthority(object, "checker"); + + if (checkerAuthority) + checker_count++; + + object->SetAuthority("checker", checkerAuthority); + + bool notificationAuthority = IsAuthority(object, "notifications"); + + if (notificationAuthority) + notifications_count++; + + object->SetAuthority("notifications", notificationAuthority); } } + + Log(LogInformation, "cluster", "Cluster authority: " + Convert::ToString(checker_count) + "x checker, " + Convert::ToString(notifications_count) + "x notifications"); } bool ClusterListener::SupportsChecks(void)