Skip to content

Commit bc1211d

Browse files
committed
Only propagate live contract count to metric
1 parent 259705b commit bc1211d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ledger/SharedModuleCacheCompiler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ SharedModuleCacheCompiler::start()
145145
mThreads.emplace_back(std::thread([this]() {
146146
ZoneScopedN("load wasm contracts");
147147
std::unordered_set<Hash> seenContracts;
148+
size_t liveContracts{0};
148149
this->mSnap->scanForEntriesOfType(
149150
CONTRACT_CODE, [&](BucketEntry const& entry) {
150151
Hash h;
@@ -155,6 +156,7 @@ SharedModuleCacheCompiler::start()
155156
h = entry.liveEntry().data.contractCode().hash;
156157
if (seenContracts.find(h) == seenContracts.end())
157158
{
159+
++liveContracts;
158160
this->pushWasm(
159161
entry.liveEntry().data.contractCode().code);
160162
}
@@ -168,7 +170,7 @@ SharedModuleCacheCompiler::start()
168170
seenContracts.insert(h);
169171
return Loop::INCOMPLETE;
170172
});
171-
this->setFinishedLoading(seenContracts.size());
173+
this->setFinishedLoading(liveContracts);
172174
}));
173175

174176
for (auto thread = 1; thread < this->mNumThreads; ++thread)

0 commit comments

Comments
 (0)