diff --git a/plugin/cpp/networkplugin.cpp b/plugin/cpp/networkplugin.cpp index c17adb7fb3d2983afe01b952ac81a46b9b4f3aeb..4c26515af81b5c16d8a68470e6d877ce603a1620 100644 --- a/plugin/cpp/networkplugin.cpp +++ b/plugin/cpp/networkplugin.cpp @@ -41,6 +41,12 @@ namespace Transport { wrap.set_payload(MESSAGE); \ wrap.SerializeToString(&MESSAGE); +template std::string stringOf(T object) { + std::ostringstream os; + os << object; + return (os.str()); +} + NetworkPlugin::NetworkPlugin() { m_pingReceived = false; @@ -603,6 +609,8 @@ void NetworkPlugin::sendMemoryUsage() { std::string message; stats.SerializeToString(&message); + stats.set_id(stringOf(getpid())); + WRAP(message, pbnetwork::WrapperMessage_Type_TYPE_STATS); send(message);