feat: add transactions.mempool.lockedTransactions and chainlocks.blockHeight stats

This commit is contained in:
pasta 2024-08-28 11:06:24 -05:00
parent 7c00c868d8
commit bf54a5dbb5
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38
2 changed files with 4 additions and 0 deletions

View File

@ -833,6 +833,7 @@ static void PeriodicStats(NodeContext& node)
const ArgsManager& args = *Assert(node.args);
ChainstateManager& chainman = *Assert(node.chainman);
const CTxMemPool& mempool = *Assert(node.mempool);
const llmq::CInstantSendManager& isman = *Assert(node.llmq_ctx->isman);
CCoinsStats stats{CoinStatsHashType::NONE};
chainman.ActiveChainstate().ForceFlushStateToDisk();
if (WITH_LOCK(cs_main, return GetUTXOStats(&chainman.ActiveChainstate().CoinsDB(), chainman.m_blockman, stats, node.rpc_interruption_point, chainman.ActiveChain().Tip()))) {
@ -880,6 +881,7 @@ static void PeriodicStats(NodeContext& node)
::g_stats_client->gauge("transactions.mempool.memoryUsageBytes", (int64_t) mempool.DynamicMemoryUsage(), 1.0f);
::g_stats_client->gauge("transactions.mempool.minFeePerKb", mempool.GetMinFee(args.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK(), 1.0f);
}
::g_stats_client.gauge("transactions.mempool.lockedTransactions", isman.GetInstantSendLockCount(), 1.0f);
}
static bool AppInitServers(NodeContext& node)

View File

@ -15,6 +15,7 @@
#include <node/ui_interface.h>
#include <scheduler.h>
#include <spork.h>
#include <statsd_client.h>
#include <txmempool.h>
#include <util/thread.h>
#include <util/time.h>
@ -499,6 +500,7 @@ void CChainLocksHandler::EnforceBestChainLock()
GetMainSignals().NotifyChainLock(currentBestChainLockBlockIndex, clsig);
uiInterface.NotifyChainLock(clsig->getBlockHash().ToString(), clsig->getHeight());
statsClient.gauge("chainlocks.blockHeight", clsig->getHeight(), 1.0f);
}
MessageProcessingResult CChainLocksHandler::HandleNewRecoveredSig(const llmq::CRecoveredSig& recoveredSig)