diff --git a/src/init.cpp b/src/init.cpp index 88e981898a..4fc2c13548 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -832,7 +832,7 @@ static void StartupNotify(const ArgsManager& args) } #endif -static void PeriodicStats(ArgsManager& args, ChainstateManager& chainman, const CTxMemPool& mempool) +static void PeriodicStats(ArgsManager& args, ChainstateManager& chainman, const CTxMemPool& mempool, const llmq::CInstantSendManager& isman) { assert(args.GetBoolArg("-statsenabled", DEFAULT_STATSD_ENABLE)); CCoinsStats stats{CoinStatsHashType::NONE}; @@ -882,6 +882,7 @@ static void PeriodicStats(ArgsManager& args, ChainstateManager& chainman, const statsClient.gauge("transactions.mempool.memoryUsageBytes", (int64_t) mempool.DynamicMemoryUsage(), 1.0f); statsClient.gauge("transactions.mempool.minFeePerKb", mempool.GetMinFee(args.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK(), 1.0f); } + statsClient.gauge("transactions.mempool.lockedTransactions", isman.GetInstantSendLockCount(), 1.0f); } static bool AppInitServers(NodeContext& node) @@ -2241,7 +2242,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) if (args.GetBoolArg("-statsenabled", DEFAULT_STATSD_ENABLE)) { int nStatsPeriod = std::min(std::max((int)args.GetArg("-statsperiod", DEFAULT_STATSD_PERIOD), MIN_STATSD_PERIOD), MAX_STATSD_PERIOD); - node.scheduler->scheduleEvery(std::bind(&PeriodicStats, std::ref(*node.args), std::ref(chainman), std::cref(*node.mempool)), std::chrono::seconds{nStatsPeriod}); + node.scheduler->scheduleEvery(std::bind(&PeriodicStats, std::ref(*node.args), std::ref(chainman), std::cref(*node.mempool), std::cref(*node.llmq_ctx->isman)), std::chrono::seconds{nStatsPeriod}); } // ********************************************************* Step 11: import blocks diff --git a/src/llmq/chainlocks.cpp b/src/llmq/chainlocks.cpp index 39130b5a07..3090c93bed 100644 --- a/src/llmq/chainlocks.cpp +++ b/src/llmq/chainlocks.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -519,6 +520,7 @@ void CChainLocksHandler::EnforceBestChainLock() GetMainSignals().NotifyChainLock(currentBestChainLockBlockIndex, clsig); uiInterface.NotifyChainLock(clsig->getBlockHash().ToString(), clsig->getHeight()); + statsClient.gauge("chainlocks.blockHeight", clsig->getHeight(), 1.0f); } void CChainLocksHandler::HandleNewRecoveredSig(const llmq::CRecoveredSig& recoveredSig)