-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add transactions.mempool.lockedTransactions and chainlocks.blockHeight stats #6237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
021e499
5b1af45
b794170
18b509d
0e4f46d
83d9f73
ebbc1dd
38d7892
d5dbbdb
abcba59
c3b1b3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2578,11 +2578,6 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, | |
| LogPrint(BCLog::BENCHMARK, " - Callbacks: %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime8 - nTime5), nTimeCallbacks * MICRO, nTimeCallbacks * MILLI / nBlocksTotal); | ||
|
|
||
| ::g_stats_client->timing("ConnectBlock_ms", (nTime8 - nTimeStart) / 1000, 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(block, PROTOCOL_VERSION), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.Version", block.nVersion, 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.NumTransactions", block.vtx.size(), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); | ||
|
|
||
| TRACE6(validation, block_connected, | ||
| block_hash.data(), | ||
|
|
@@ -2901,6 +2896,8 @@ bool CChainState::DisconnectTip(BlockValidationState& state, DisconnectedBlockTr | |
| AssertLockHeld(cs_main); | ||
| if (m_mempool) AssertLockHeld(m_mempool->cs); | ||
|
|
||
| int64_t nTime1 = GetTimeMicros(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using here
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's better to use |
||
|
|
||
| CBlockIndex *pindexDelete = m_chain.Tip(); | ||
| assert(pindexDelete); | ||
| // Read block from disk. | ||
|
|
@@ -2959,6 +2956,19 @@ bool CChainState::DisconnectTip(BlockValidationState& state, DisconnectedBlockTr | |
| // Let wallets know transactions went from 1-confirmed to | ||
| // 0-confirmed or conflicted: | ||
| GetMainSignals().BlockDisconnected(pblock, pindexDelete); | ||
|
|
||
| int64_t nTime2 = GetTimeMicros(); | ||
|
|
||
| unsigned int nSigOps = 0; | ||
| for (const auto& tx : block.vtx) { | ||
| nSigOps += GetLegacySigOpCount(*tx); | ||
| } | ||
| ::g_stats_client->timing("DisconnectTip_ms", (nTime2 - nTime1) / 1000, 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(block, PROTOCOL_VERSION), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.Version", block.nVersion, 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.NumTransactions", block.vtx.size(), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); | ||
| return true; | ||
| } | ||
|
|
||
|
|
@@ -3077,7 +3087,16 @@ bool CChainState::ConnectTip(BlockValidationState& state, CBlockIndex* pindexNew | |
| LogPrint(BCLog::BENCHMARK, " - Connect postprocess: %.2fms [%.2fs (%.2fms/blk)]\n", (nTime6 - nTime5) * MILLI, nTimePostConnect * MICRO, nTimePostConnect * MILLI / nBlocksTotal); | ||
| LogPrint(BCLog::BENCHMARK, "- Connect block: %.2fms [%.2fs (%.2fms/blk)]\n", (nTime6 - nTime1) * MILLI, nTimeTotal * MICRO, nTimeTotal * MILLI / nBlocksTotal); | ||
|
|
||
| unsigned int nSigOps = 0; | ||
| for (const auto& tx : blockConnecting.vtx) { | ||
| nSigOps += GetLegacySigOpCount(*tx); | ||
| } | ||
| ::g_stats_client->timing("ConnectTip_ms", (nTime6 - nTime1) / 1000, 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(blockConnecting, PROTOCOL_VERSION), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.Version", blockConnecting.nVersion, 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.NumTransactions", blockConnecting.vtx.size(), 1.0f); | ||
| ::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); | ||
|
|
||
| connectTrace.BlockConnected(pindexNew, std::move(pthisBlock)); | ||
| return true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems as this map can indefinitely grow and eat
allsignificant amount of RAMThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in d5dbbdb