[icinga-checkins] icinga.org: icinga2/master: cluster: Speed up log replays.

git at icinga.org git at icinga.org
Fri Sep 6 09:59:23 CEST 2013


Module: icinga2
Branch: master
Commit: 2daa2cae854d3f298be59af24acef2fe97468224
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=2daa2cae854d3f298be59af24acef2fe97468224

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Sep  6 09:59:16 2013 +0200

cluster: Speed up log replays.

---

 components/cluster/clustercomponent.cpp |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/components/cluster/clustercomponent.cpp b/components/cluster/clustercomponent.cpp
index 8f6d077..b3c5e4e 100644
--- a/components/cluster/clustercomponent.cpp
+++ b/components/cluster/clustercomponent.cpp
@@ -221,7 +221,7 @@ void ClusterComponent::RelayMessage(const Endpoint::Ptr& except, const Dictionar
 		if (except)
 			pmessage->Set("except", except->GetName());
 
-		pmessage->Set("message", message);
+		pmessage->Set("message", Value(message).Serialize());
 
 		ObjectLock olock(this);
 		if (m_LogFile) {
@@ -360,8 +360,7 @@ void ClusterComponent::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Pt
 			if (pmessage->Get("except") == endpoint->GetName())
 				continue;
 
-			String json = Value(pmessage->Get("message")).Serialize();
-			NetString::WriteStringToStream(stream, json);
+			NetString::WriteStringToStream(stream, pmessage->Get("message"));
 			count++;
 		}
 





More information about the icinga-checkins mailing list