mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-26 11:08:51 +02:00
Log can't-do-yets summmary
This commit is contained in:
parent
4d90cc88af
commit
a652c4f52a
@ -85,6 +85,14 @@ void IdoMysqlConnection::Resume()
|
||||
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&IdoMysqlConnection::ReconnectTimerHandler, this));
|
||||
m_ReconnectTimer->Start();
|
||||
|
||||
m_RescheduledQueriesLogTimer = new Timer();
|
||||
m_RescheduledQueriesLogTimer->SetInterval(10);
|
||||
m_RescheduledQueriesLogTimer->OnTimerExpired.connect([this](const Timer * const&) {
|
||||
Log(LogDebug, "IdoMysqlConnectionDebug")
|
||||
<< "Re-scheduled " << m_RescheduledQueries.exchange(0) << " in the last 10s";
|
||||
});
|
||||
m_RescheduledQueriesLogTimer->Start();
|
||||
|
||||
/* Start with queries after connect. */
|
||||
DbConnection::Resume();
|
||||
|
||||
@ -1008,6 +1016,7 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
|
||||
ASSERT(query.Type == DbQueryNewTransaction || query.Category != DbCatInvalid);
|
||||
|
||||
if (!CanExecuteQuery(query)) {
|
||||
m_RescheduledQueries.fetch_add(1);
|
||||
|
||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||
Log(LogDebug, "IdoMysqlConnection")
|
||||
@ -1058,6 +1067,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
||||
|
||||
/* check if there are missing object/insert ids and re-enqueue the query */
|
||||
if (!CanExecuteQuery(query)) {
|
||||
m_RescheduledQueries.fetch_add(1);
|
||||
|
||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||
Log(LogDebug, "IdoMysqlConnection")
|
||||
@ -1081,6 +1091,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
||||
|
||||
for (const Dictionary::Pair& kv : query.WhereCriteria) {
|
||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
||||
m_RescheduledQueries.fetch_add(1);
|
||||
|
||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||
Log(LogDebug, "IdoMysqlConnection")
|
||||
@ -1161,6 +1172,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
||||
continue;
|
||||
|
||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
||||
m_RescheduledQueries.fetch_add(1);
|
||||
|
||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||
Log(LogDebug, "IdoMysqlConnection")
|
||||
|
@ -64,9 +64,11 @@ private:
|
||||
|
||||
std::vector<IdoAsyncQuery> m_AsyncQueries;
|
||||
uint_fast32_t m_UncommittedAsyncQueries = 0;
|
||||
std::atomic<uint_fast32_t> m_RescheduledQueries {0};
|
||||
|
||||
Timer::Ptr m_ReconnectTimer;
|
||||
Timer::Ptr m_TxTimer;
|
||||
Timer::Ptr m_RescheduledQueriesLogTimer;
|
||||
|
||||
IdoMysqlResult Query(const String& query);
|
||||
DbReference GetLastInsertID();
|
||||
|
Loading…
x
Reference in New Issue
Block a user