]> granicus.if.org Git - icinga2/commitdiff
DB IDO: Add a log message when the connection handling is completed
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 15 Dec 2015 15:50:17 +0000 (16:50 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 23 Feb 2016 08:14:39 +0000 (09:14 +0100)
fixes #10857

lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp

index b18c5be9d36efdf286f6d022e562f0db3befb2ab..5b1bfd057152ba5776ae89b3c5a7683d91c05c33 100644 (file)
@@ -167,6 +167,7 @@ void IdoMysqlConnection::Reconnect(void)
 
        CONTEXT("Reconnecting to MySQL IDO database '" + GetName() + "'");
 
+       double startTime = Utility::GetTime();
        m_SessionToken = static_cast<int>(Utility::GetTime());
 
        SetShouldConnect(true);
@@ -386,6 +387,9 @@ void IdoMysqlConnection::Reconnect(void)
        ClearCustomVarTable("customvariables");
        ClearCustomVarTable("customvariablestatus");
 
+       Log(LogInformation, "IdoMysqlConnection")
+           << "Finished reconnecting to MySQL IDO database in " << std::setw(2) << Utility::GetTime() - startTime << " second(s).";
+
        Query("COMMIT");
        Query("BEGIN");
 }
index fa52eec80341f88248be63e0a72b2dbd88a62458..eb5bce15f1eeddd969953dc6ce0681b1a638e262 100644 (file)
@@ -164,6 +164,7 @@ void IdoPgsqlConnection::Reconnect(void)
 
        CONTEXT("Reconnecting to PostgreSQL IDO database '" + GetName() + "'");
 
+       double startTime = Utility::GetTime();
        m_SessionToken = static_cast<int>(Utility::GetTime());
 
        SetShouldConnect(true);
@@ -376,6 +377,9 @@ void IdoPgsqlConnection::Reconnect(void)
        ClearCustomVarTable("customvariables");
        ClearCustomVarTable("customvariablestatus");
 
+       Log(LogInformation, "IdoPgsqlConnection")
+           << "Finished reconnecting to PostgreSQL IDO database in " << std::setw(2) << Utility::GetTime() - startTime << " second(s).";
+
        Query("COMMIT");
        Query("BEGIN");
 }