mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
stats: s/statsClient/g_stats_client/g
This commit is contained in:
parent
f81951dd00
commit
5133d88415
40
src/init.cpp
40
src/init.cpp
@ -289,7 +289,7 @@ void PrepareShutdown(NodeContext& node)
|
||||
node.banman.reset();
|
||||
node.addrman.reset();
|
||||
node.netgroupman.reset();
|
||||
::statsClient.reset();
|
||||
::g_stats_client.reset();
|
||||
|
||||
if (node.mempool && node.mempool->IsLoaded() && node.args->GetBoolArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
DumpMempool(*node.mempool);
|
||||
@ -840,12 +840,12 @@ static void PeriodicStats(ArgsManager& args, ChainstateManager& chainman, const
|
||||
CCoinsStats stats{CoinStatsHashType::NONE};
|
||||
chainman.ActiveChainstate().ForceFlushStateToDisk();
|
||||
if (WITH_LOCK(cs_main, return GetUTXOStats(&chainman.ActiveChainstate().CoinsDB(), std::ref(chainman.m_blockman), stats, RpcInterruptionPoint, chainman.ActiveChain().Tip()))) {
|
||||
::statsClient->gauge("utxoset.tx", stats.nTransactions, 1.0f);
|
||||
::statsClient->gauge("utxoset.txOutputs", stats.nTransactionOutputs, 1.0f);
|
||||
::statsClient->gauge("utxoset.dbSizeBytes", stats.nDiskSize, 1.0f);
|
||||
::statsClient->gauge("utxoset.blockHeight", stats.nHeight, 1.0f);
|
||||
::g_stats_client->gauge("utxoset.tx", stats.nTransactions, 1.0f);
|
||||
::g_stats_client->gauge("utxoset.txOutputs", stats.nTransactionOutputs, 1.0f);
|
||||
::g_stats_client->gauge("utxoset.dbSizeBytes", stats.nDiskSize, 1.0f);
|
||||
::g_stats_client->gauge("utxoset.blockHeight", stats.nHeight, 1.0f);
|
||||
if (stats.total_amount.has_value()) {
|
||||
::statsClient->gauge("utxoset.totalAmount", (double)stats.total_amount.value() / (double)COIN, 1.0f);
|
||||
::g_stats_client->gauge("utxoset.totalAmount", (double)stats.total_amount.value() / (double)COIN, 1.0f);
|
||||
}
|
||||
} else {
|
||||
// something went wrong
|
||||
@ -867,22 +867,22 @@ static void PeriodicStats(ArgsManager& args, ChainstateManager& chainman, const
|
||||
int64_t timeDiff = maxTime - minTime;
|
||||
double nNetworkHashPS = workDiff.getdouble() / timeDiff;
|
||||
|
||||
::statsClient->gaugeDouble("network.hashesPerSecond", nNetworkHashPS);
|
||||
::statsClient->gaugeDouble("network.terahashesPerSecond", nNetworkHashPS / 1e12);
|
||||
::statsClient->gaugeDouble("network.petahashesPerSecond", nNetworkHashPS / 1e15);
|
||||
::statsClient->gaugeDouble("network.exahashesPerSecond", nNetworkHashPS / 1e18);
|
||||
::g_stats_client->gaugeDouble("network.hashesPerSecond", nNetworkHashPS);
|
||||
::g_stats_client->gaugeDouble("network.terahashesPerSecond", nNetworkHashPS / 1e12);
|
||||
::g_stats_client->gaugeDouble("network.petahashesPerSecond", nNetworkHashPS / 1e15);
|
||||
::g_stats_client->gaugeDouble("network.exahashesPerSecond", nNetworkHashPS / 1e18);
|
||||
// No need for cs_main, we never use null tip here
|
||||
::statsClient->gaugeDouble("network.difficulty", (double)GetDifficulty(tip));
|
||||
::g_stats_client->gaugeDouble("network.difficulty", (double)GetDifficulty(tip));
|
||||
|
||||
::statsClient->gauge("transactions.txCacheSize", WITH_LOCK(cs_main, return chainman.ActiveChainstate().CoinsTip().GetCacheSize()), 1.0f);
|
||||
::statsClient->gauge("transactions.totalTransactions", tip->nChainTx, 1.0f);
|
||||
::g_stats_client->gauge("transactions.txCacheSize", WITH_LOCK(cs_main, return chainman.ActiveChainstate().CoinsTip().GetCacheSize()), 1.0f);
|
||||
::g_stats_client->gauge("transactions.totalTransactions", tip->nChainTx, 1.0f);
|
||||
|
||||
{
|
||||
LOCK(mempool.cs);
|
||||
::statsClient->gauge("transactions.mempool.totalTransactions", mempool.size(), 1.0f);
|
||||
::statsClient->gauge("transactions.mempool.totalTxBytes", (int64_t) mempool.GetTotalTxSize(), 1.0f);
|
||||
::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);
|
||||
::g_stats_client->gauge("transactions.mempool.totalTransactions", mempool.size(), 1.0f);
|
||||
::g_stats_client->gauge("transactions.mempool.totalTxBytes", (int64_t) mempool.GetTotalTxSize(), 1.0f);
|
||||
::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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1525,10 +1525,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
fDiscover = args.GetBoolArg("-discover", true);
|
||||
const bool ignores_incoming_txs{args.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)};
|
||||
|
||||
// We need to initialize statsClient early as currently, statsClient is called
|
||||
// We need to initialize g_stats_client early as currently, g_stats_client is called
|
||||
// regardless of whether transmitting stats are desirable or not and if
|
||||
// statsClient isn't present when that attempt is made, the client will crash.
|
||||
::statsClient = std::make_unique<statsd::StatsdClient>();
|
||||
// g_stats_client isn't present when that attempt is made, the client will crash.
|
||||
::g_stats_client = std::make_unique<statsd::StatsdClient>();
|
||||
|
||||
{
|
||||
|
||||
|
40
src/net.cpp
40
src/net.cpp
@ -623,7 +623,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
|
||||
/*inbound_onion=*/false,
|
||||
std::move(i2p_transient_session));
|
||||
pnode->AddRef();
|
||||
::statsClient->inc("peers.connect", 1.0f);
|
||||
::g_stats_client->inc("peers.connect", 1.0f);
|
||||
|
||||
// We're making a new connection, harvest entropy from the time (and our peer count)
|
||||
RandAddEvent((uint32_t)id);
|
||||
@ -666,7 +666,7 @@ void CNode::CloseSocketDisconnect(CConnman* connman)
|
||||
m_sock.reset();
|
||||
m_i2p_sam_session.reset();
|
||||
|
||||
::statsClient->inc("peers.disconnect", 1.0f);
|
||||
::g_stats_client->inc("peers.disconnect", 1.0f);
|
||||
}
|
||||
|
||||
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr) const {
|
||||
@ -817,7 +817,7 @@ bool CNode::ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete)
|
||||
}
|
||||
assert(i != mapRecvBytesPerMsgType.end());
|
||||
i->second += msg.m_raw_message_size;
|
||||
::statsClient->count("bandwidth.message." + std::string(msg.m_type) + ".bytesReceived", msg.m_raw_message_size, 1.0f);
|
||||
::g_stats_client->count("bandwidth.message." + std::string(msg.m_type) + ".bytesReceived", msg.m_raw_message_size, 1.0f);
|
||||
|
||||
// push the message to the process queue,
|
||||
vRecvMsg.push_back(std::move(msg));
|
||||
@ -1741,20 +1741,20 @@ void CConnman::CalculateNumConnectionsChangedStats()
|
||||
torNodes++;
|
||||
const auto last_ping_time = count_microseconds(pnode->m_last_ping_time);
|
||||
if (last_ping_time > 0)
|
||||
::statsClient->timing("peers.ping_us", last_ping_time, 1.0f);
|
||||
::g_stats_client->timing("peers.ping_us", last_ping_time, 1.0f);
|
||||
}
|
||||
for (const std::string &msg : getAllNetMessageTypes()) {
|
||||
::statsClient->gauge("bandwidth.message." + msg + ".totalBytesReceived", mapRecvBytesMsgStats[msg], 1.0f);
|
||||
::statsClient->gauge("bandwidth.message." + msg + ".totalBytesSent", mapSentBytesMsgStats[msg], 1.0f);
|
||||
::g_stats_client->gauge("bandwidth.message." + msg + ".totalBytesReceived", mapRecvBytesMsgStats[msg], 1.0f);
|
||||
::g_stats_client->gauge("bandwidth.message." + msg + ".totalBytesSent", mapSentBytesMsgStats[msg], 1.0f);
|
||||
}
|
||||
::statsClient->gauge("peers.totalConnections", nPrevNodeCount, 1.0f);
|
||||
::statsClient->gauge("peers.spvNodeConnections", spvNodes, 1.0f);
|
||||
::statsClient->gauge("peers.fullNodeConnections", fullNodes, 1.0f);
|
||||
::statsClient->gauge("peers.inboundConnections", inboundNodes, 1.0f);
|
||||
::statsClient->gauge("peers.outboundConnections", outboundNodes, 1.0f);
|
||||
::statsClient->gauge("peers.ipv4Connections", ipv4Nodes, 1.0f);
|
||||
::statsClient->gauge("peers.ipv6Connections", ipv6Nodes, 1.0f);
|
||||
::statsClient->gauge("peers.torConnections", torNodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.totalConnections", nPrevNodeCount, 1.0f);
|
||||
::g_stats_client->gauge("peers.spvNodeConnections", spvNodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.fullNodeConnections", fullNodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.inboundConnections", inboundNodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.outboundConnections", outboundNodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.ipv4Connections", ipv4Nodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.ipv6Connections", ipv6Nodes, 1.0f);
|
||||
::g_stats_client->gauge("peers.torConnections", torNodes, 1.0f);
|
||||
}
|
||||
|
||||
bool CConnman::ShouldRunInactivityChecks(const CNode& node, std::chrono::seconds now) const
|
||||
@ -4124,8 +4124,8 @@ bool CConnman::DisconnectNode(NodeId id)
|
||||
void CConnman::RecordBytesRecv(uint64_t bytes)
|
||||
{
|
||||
nTotalBytesRecv += bytes;
|
||||
::statsClient->count("bandwidth.bytesReceived", bytes, 0.1f);
|
||||
::statsClient->gauge("bandwidth.totalBytesReceived", nTotalBytesRecv, 0.01f);
|
||||
::g_stats_client->count("bandwidth.bytesReceived", bytes, 0.1f);
|
||||
::g_stats_client->gauge("bandwidth.totalBytesReceived", nTotalBytesRecv, 0.01f);
|
||||
}
|
||||
|
||||
void CConnman::RecordBytesSent(uint64_t bytes)
|
||||
@ -4134,8 +4134,8 @@ void CConnman::RecordBytesSent(uint64_t bytes)
|
||||
LOCK(m_total_bytes_sent_mutex);
|
||||
|
||||
nTotalBytesSent += bytes;
|
||||
::statsClient->count("bandwidth.bytesSent", bytes, 0.01f);
|
||||
::statsClient->gauge("bandwidth.totalBytesSent", nTotalBytesSent, 0.01f);
|
||||
::g_stats_client->count("bandwidth.bytesSent", bytes, 0.01f);
|
||||
::g_stats_client->gauge("bandwidth.totalBytesSent", nTotalBytesSent, 0.01f);
|
||||
|
||||
const auto now = GetTime<std::chrono::seconds>();
|
||||
if (nMaxOutboundCycleStartTime + MAX_UPLOAD_TIMEFRAME < now)
|
||||
@ -4291,8 +4291,8 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
|
||||
msg.data.data()
|
||||
);
|
||||
|
||||
::statsClient->count(strprintf("bandwidth.message.%s.bytesSent", msg.m_type), nMessageSize, 1.0f);
|
||||
::statsClient->inc(strprintf("message.sent.%s", msg.m_type), 1.0f);
|
||||
::g_stats_client->count(strprintf("bandwidth.message.%s.bytesSent", msg.m_type), nMessageSize, 1.0f);
|
||||
::g_stats_client->inc(strprintf("message.sent.%s", msg.m_type), 1.0f);
|
||||
|
||||
{
|
||||
LOCK(pnode->cs_vSend);
|
||||
|
@ -1688,9 +1688,9 @@ void PeerManagerImpl::Misbehaving(const NodeId pnode, const int howmuch, const s
|
||||
if (score_now >= DISCOURAGEMENT_THRESHOLD && score_before < DISCOURAGEMENT_THRESHOLD) {
|
||||
warning = " DISCOURAGE THRESHOLD EXCEEDED";
|
||||
peer->m_should_discourage = true;
|
||||
::statsClient->inc("misbehavior.banned", 1.0f);
|
||||
::g_stats_client->inc("misbehavior.banned", 1.0f);
|
||||
} else {
|
||||
::statsClient->count("misbehavior.amount", howmuch, 1.0);
|
||||
::g_stats_client->count("misbehavior.amount", howmuch, 1.0);
|
||||
}
|
||||
|
||||
LogPrint(BCLog::NET, "Misbehaving: peer=%d (%d -> %d)%s%s\n",
|
||||
@ -3260,7 +3260,7 @@ void PeerManagerImpl::ProcessMessage(
|
||||
AssertLockHeld(g_msgproc_mutex);
|
||||
|
||||
LogPrint(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(msg_type), vRecv.size(), pfrom.GetId());
|
||||
::statsClient->inc("message.received." + SanitizeString(msg_type), 1.0f);
|
||||
::g_stats_client->inc("message.received." + SanitizeString(msg_type), 1.0f);
|
||||
|
||||
const bool is_masternode = m_mn_activeman != nullptr;
|
||||
|
||||
@ -3759,7 +3759,7 @@ void PeerManagerImpl::ProcessMessage(
|
||||
if (inv.IsMsgBlk()) {
|
||||
const bool fAlreadyHave = AlreadyHaveBlock(inv.hash);
|
||||
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
|
||||
::statsClient->inc(strprintf("message.received.inv_%s", inv.GetCommand()), 1.0f);
|
||||
::g_stats_client->inc(strprintf("message.received.inv_%s", inv.GetCommand()), 1.0f);
|
||||
|
||||
UpdateBlockAvailability(pfrom.GetId(), inv.hash);
|
||||
if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(inv.hash)) {
|
||||
@ -3774,7 +3774,7 @@ void PeerManagerImpl::ProcessMessage(
|
||||
} else {
|
||||
const bool fAlreadyHave = AlreadyHave(inv);
|
||||
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
|
||||
::statsClient->inc(strprintf("message.received.inv_%s", inv.GetCommand()), 1.0f);
|
||||
::g_stats_client->inc(strprintf("message.received.inv_%s", inv.GetCommand()), 1.0f);
|
||||
|
||||
static std::set<int> allowWhileInIBDObjs = {
|
||||
MSG_SPORK
|
||||
|
@ -38,7 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
|
||||
std::unique_ptr<statsd::StatsdClient> statsClient;
|
||||
std::unique_ptr<statsd::StatsdClient> g_stats_client;
|
||||
|
||||
namespace statsd {
|
||||
|
||||
|
@ -66,6 +66,6 @@ class StatsdClient {
|
||||
|
||||
} // namespace statsd
|
||||
|
||||
extern std::unique_ptr<statsd::StatsdClient> statsClient;
|
||||
extern std::unique_ptr<statsd::StatsdClient> g_stats_client;
|
||||
|
||||
#endif // BITCOIN_STATSD_CLIENT_H
|
||||
|
@ -183,7 +183,7 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::ve
|
||||
SetupNetworking();
|
||||
InitSignatureCache();
|
||||
InitScriptExecutionCache();
|
||||
::statsClient = std::make_unique<statsd::StatsdClient>();
|
||||
::g_stats_client = std::make_unique<statsd::StatsdClient>();
|
||||
m_node.chain = interfaces::MakeChain(m_node);
|
||||
|
||||
m_node.netgroupman = std::make_unique<NetGroupManager>(/*asmap=*/std::vector<bool>());
|
||||
@ -219,7 +219,7 @@ BasicTestingSetup::~BasicTestingSetup()
|
||||
m_node.connman.reset();
|
||||
m_node.addrman.reset();
|
||||
m_node.netgroupman.reset();
|
||||
::statsClient.reset();
|
||||
::g_stats_client.reset();
|
||||
|
||||
LogInstance().DisconnectTestLogger();
|
||||
fs::remove_all(m_path_root);
|
||||
|
@ -51,8 +51,8 @@ bool TxOrphanage::AddTx(const CTransactionRef& tx, NodeId peer)
|
||||
|
||||
LogPrint(BCLog::MEMPOOL, "stored orphan tx %s (mapsz %u outsz %u)\n", hash.ToString(),
|
||||
m_orphans.size(), m_outpoint_to_orphan_it.size());
|
||||
::statsClient->inc("transactions.orphans.add", 1.0f);
|
||||
::statsClient->gauge("transactions.orphans", m_orphans.size());
|
||||
::g_stats_client->inc("transactions.orphans.add", 1.0f);
|
||||
::g_stats_client->gauge("transactions.orphans", m_orphans.size());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -87,8 +87,8 @@ int TxOrphanage::EraseTx(const uint256& txid)
|
||||
assert(m_orphan_tx_size >= it->second.nTxSize);
|
||||
m_orphan_tx_size -= it->second.nTxSize;
|
||||
m_orphans.erase(it);
|
||||
::statsClient->inc("transactions.orphans.remove", 1.0f);
|
||||
::statsClient->gauge("transactions.orphans", m_orphans.size());
|
||||
::g_stats_client->inc("transactions.orphans.remove", 1.0f);
|
||||
::g_stats_client->gauge("transactions.orphans", m_orphans.size());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||
|
||||
// is it already in the memory pool?
|
||||
if (m_pool.exists(hash)) {
|
||||
::statsClient->inc("transactions.duplicate", 1.0f);
|
||||
::g_stats_client->inc("transactions.duplicate", 1.0f);
|
||||
return state.Invalid(TxValidationResult::TX_CONFLICT, "txn-already-in-mempool");
|
||||
}
|
||||
|
||||
@ -838,11 +838,11 @@ bool MemPoolAccept::Finalize(const ATMPArgs& args, Workspace& ws)
|
||||
CAmount nValueOut = tx.GetValueOut();
|
||||
unsigned int nSigOps = GetTransactionSigOpCount(tx, m_view, STANDARD_SCRIPT_VERIFY_FLAGS);
|
||||
|
||||
::statsClient->count("transactions.sizeBytes", entry->GetTxSize(), 1.0f);
|
||||
::statsClient->count("transactions.fees", nModifiedFees, 1.0f);
|
||||
::statsClient->count("transactions.inputValue", nValueOut - nModifiedFees, 1.0f);
|
||||
::statsClient->count("transactions.outputValue", nValueOut, 1.0f);
|
||||
::statsClient->count("transactions.sigOps", nSigOps, 1.0f);
|
||||
::g_stats_client->count("transactions.sizeBytes", entry->GetTxSize(), 1.0f);
|
||||
::g_stats_client->count("transactions.fees", nModifiedFees, 1.0f);
|
||||
::g_stats_client->count("transactions.inputValue", nValueOut - nModifiedFees, 1.0f);
|
||||
::g_stats_client->count("transactions.outputValue", nValueOut, 1.0f);
|
||||
::g_stats_client->count("transactions.sigOps", nSigOps, 1.0f);
|
||||
|
||||
// Add memory address index
|
||||
if (fAddressIndex) {
|
||||
@ -895,10 +895,10 @@ MempoolAcceptResult MemPoolAccept::AcceptSingleTransaction(const CTransactionRef
|
||||
const CTransaction& tx = *ptx;
|
||||
auto finish = Now<SteadyMilliseconds>();
|
||||
auto diff = finish - start;
|
||||
::statsClient->timing("AcceptToMemoryPool_ms", count_milliseconds(diff), 1.0f);
|
||||
::statsClient->inc("transactions.accepted", 1.0f);
|
||||
::statsClient->count("transactions.inputs", tx.vin.size(), 1.0f);
|
||||
::statsClient->count("transactions.outputs", tx.vout.size(), 1.0f);
|
||||
::g_stats_client->timing("AcceptToMemoryPool_ms", count_milliseconds(diff), 1.0f);
|
||||
::g_stats_client->inc("transactions.accepted", 1.0f);
|
||||
::g_stats_client->count("transactions.inputs", tx.vin.size(), 1.0f);
|
||||
::g_stats_client->count("transactions.outputs", tx.vout.size(), 1.0f);
|
||||
|
||||
return MempoolAcceptResult::Success(ws.m_base_fees);
|
||||
}
|
||||
@ -1319,7 +1319,7 @@ void CChainState::InvalidChainFound(CBlockIndex* pindexNew)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
::statsClient->inc("warnings.InvalidChainFound", 1.0f);
|
||||
::g_stats_client->inc("warnings.InvalidChainFound", 1.0f);
|
||||
|
||||
if (!m_chainman.m_best_invalid || pindexNew->nChainWork > m_chainman.m_best_invalid->nChainWork) {
|
||||
m_chainman.m_best_invalid = pindexNew;
|
||||
@ -1343,7 +1343,7 @@ void CChainState::ConflictingChainFound(CBlockIndex* pindexNew)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
::statsClient->inc("warnings.ConflictingChainFound", 1.0f);
|
||||
::g_stats_client->inc("warnings.ConflictingChainFound", 1.0f);
|
||||
|
||||
LogPrintf("%s: conflicting block=%s height=%d log2_work=%f date=%s\n", __func__,
|
||||
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight,
|
||||
@ -1362,7 +1362,7 @@ void CChainState::InvalidBlockFound(CBlockIndex *pindex, const BlockValidationSt
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
::statsClient->inc("warnings.InvalidBlockFound", 1.0f);
|
||||
::g_stats_client->inc("warnings.InvalidBlockFound", 1.0f);
|
||||
if (state.GetResult() != BlockValidationResult::BLOCK_MUTATED) {
|
||||
pindex->nStatus |= BLOCK_FAILED_VALID;
|
||||
m_chainman.m_failed_blocks.insert(pindex);
|
||||
@ -1526,7 +1526,7 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState &state, const C
|
||||
|
||||
auto finish = Now<SteadyMilliseconds>();
|
||||
auto diff = finish - start;
|
||||
::statsClient->timing("CheckInputScripts_ms", count_milliseconds(diff), 1.0f);
|
||||
::g_stats_client->timing("CheckInputScripts_ms", count_milliseconds(diff), 1.0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1729,7 +1729,7 @@ DisconnectResult CChainState::DisconnectBlock(const CBlock& block, const CBlockI
|
||||
|
||||
auto finish = Now<SteadyMilliseconds>();
|
||||
auto diff = finish - start;
|
||||
::statsClient->timing("DisconnectBlock_ms", count_milliseconds(diff), 1.0f);
|
||||
::g_stats_client->timing("DisconnectBlock_ms", count_milliseconds(diff), 1.0f);
|
||||
|
||||
return fClean ? DISCONNECT_OK : DISCONNECT_UNCLEAN;
|
||||
}
|
||||
@ -2296,12 +2296,12 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
||||
int64_t nTime8 = GetTimeMicros(); nTimeCallbacks += nTime8 - nTime5;
|
||||
LogPrint(BCLog::BENCHMARK, " - Callbacks: %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime8 - nTime5), nTimeCallbacks * MICRO, nTimeCallbacks * MILLI / nBlocksTotal);
|
||||
|
||||
::statsClient->timing("ConnectBlock_ms", (nTime8 - nTimeStart) / 1000, 1.0f);
|
||||
::statsClient->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(block, PROTOCOL_VERSION), 1.0f);
|
||||
::statsClient->gauge("blocks.tip.Height", m_chain.Height(), 1.0f);
|
||||
::statsClient->gauge("blocks.tip.Version", block.nVersion, 1.0f);
|
||||
::statsClient->gauge("blocks.tip.NumTransactions", block.vtx.size(), 1.0f);
|
||||
::statsClient->gauge("blocks.tip.SigOps", nSigOps, 1.0f);
|
||||
::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.GetHash().data(),
|
||||
@ -2772,7 +2772,7 @@ 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);
|
||||
|
||||
::statsClient->timing("ConnectTip_ms", (nTime6 - nTime1) / 1000, 1.0f);
|
||||
::g_stats_client->timing("ConnectTip_ms", (nTime6 - nTime1) / 1000, 1.0f);
|
||||
|
||||
connectTrace.BlockConnected(pindexNew, std::move(pthisBlock));
|
||||
return true;
|
||||
@ -3084,7 +3084,7 @@ bool CChainState::ActivateBestChain(BlockValidationState& state, std::shared_ptr
|
||||
|
||||
auto finish = Now<SteadyMilliseconds>();
|
||||
auto diff = finish - start;
|
||||
::statsClient->timing("ActivateBestChain_ms", count_milliseconds(diff), 1.0f);
|
||||
::g_stats_client->timing("ActivateBestChain_ms", count_milliseconds(diff), 1.0f);
|
||||
|
||||
// Write changes periodically to disk, after relay.
|
||||
if (!FlushStateToDisk(state, FlushStateMode::PERIODIC)) {
|
||||
@ -3572,7 +3572,7 @@ bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensu
|
||||
|
||||
auto finish = Now<SteadyMicroseconds>();
|
||||
auto diff = finish - start;
|
||||
::statsClient->timing("CheckBlock_us", count_microseconds(diff), 1.0f);
|
||||
::g_stats_client->timing("CheckBlock_us", count_microseconds(diff), 1.0f);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -3943,7 +3943,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, Block
|
||||
|
||||
auto finish = Now<SteadyMicroseconds>();
|
||||
auto diff = finish - start;
|
||||
::statsClient->timing("AcceptBlock_us", count_microseconds(diff), 1.0f);
|
||||
::g_stats_client->timing("AcceptBlock_us", count_microseconds(diff), 1.0f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user