Skip to content

Commit aab337a

Browse files
committed
Update names/comments
1 parent 33d60c8 commit aab337a

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/ledger/LedgerManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ class LedgerManager
302302

303303
// Records the submission time of a self-submitted transaction for the
304304
// tx-latency metrics. No-op unless
305-
// Config::LOADGEN_MEASURE_TX_LATENCY_FOR_TESTING is set.
305+
// Config::LOADGEN_MEASURE_TX_E2E_LATENCY_FOR_TESTING is set.
306306
virtual void recordTxSubmission(Hash const& contentsHash) = 0;
307307

308308
// Begins/ends a load-generation latency measurement window. No-op unless
309-
// Config::LOADGEN_MEASURE_TX_LATENCY_FOR_TESTING is set.
309+
// Config::LOADGEN_MEASURE_TX_E2E_LATENCY_FOR_TESTING is set.
310310
virtual void beginTxLatencyMeasurement(uint32_t expectedTxCount) = 0;
311311
virtual void finalizeTxLatencyMeasurement() = 0;
312312
#endif

src/ledger/LedgerManagerImpl.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,14 +1362,13 @@ LedgerManagerImpl::recordTxSubmission(Hash const& contentsHash)
13621362
}
13631363

13641364
void
1365-
LedgerManagerImpl::recordTxMetaEmissionLatency(
1366-
ApplicableTxSetFrame const& txSet)
1365+
LedgerManagerImpl::recordTxE2eLatency(ApplicableTxSetFrame const& txSet)
13671366
{
13681367
if (!mApp.getConfig().LOADGEN_MEASURE_TX_E2E_LATENCY_FOR_TESTING)
13691368
{
13701369
return;
13711370
}
1372-
VirtualClock::time_point const emitTime = mApp.getClock().now();
1371+
VirtualClock::time_point const applyEndTime = mApp.getClock().now();
13731372
MutexLocker guard(mTxLatencyMetrics.mMutex);
13741373
for (auto const& phase : txSet.getPhases())
13751374
{
@@ -1379,7 +1378,7 @@ LedgerManagerImpl::recordTxMetaEmissionLatency(
13791378
tx->getContentsHash());
13801379
submitted != mTxLatencyMetrics.mTxSubmitTimes.end())
13811380
{
1382-
auto const latency = emitTime - submitted->second;
1381+
auto const latency = applyEndTime - submitted->second;
13831382
mTxLatencyMetrics.mTxsExternalized.inc();
13841383
int64_t const ms =
13851384
std::chrono::duration_cast<std::chrono::milliseconds>(
@@ -2032,7 +2031,7 @@ LedgerManagerImpl::applyLedger(LedgerCloseData const& ledgerData,
20322031
#ifdef BUILD_TESTS
20332032
maybeSimulateSleep(mApp.getConfig(), txSet->sizeOpTotalForLogging(),
20342033
applyLedgerTime, mApplySleepRng);
2035-
recordTxMetaEmissionLatency(*applicableTxSet);
2034+
recordTxE2eLatency(*applicableTxSet);
20362035
#endif
20372036

20382037
// Steps 6, 7, 8 are done in `advanceLedgerStateAndPublish`

src/ledger/LedgerManagerImpl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,15 @@ class LedgerManagerImpl : public LedgerManager
451451
ANNOTATED_MUTEX(mMutex);
452452
UnorderedMap<Hash, VirtualClock::time_point>
453453
mTxSubmitTimes GUARDED_BY(mMutex);
454-
// Each recorded submission -> meta-emission latency in ms
454+
// Each recorded submission -> post-apply latency in ms
455455
std::vector<uint32_t> mSamples GUARDED_BY(mMutex);
456456

457457
TxLatencyMetrics(MetricsRegistry& registry);
458458
} mTxLatencyMetrics;
459459

460-
// End point of the tx-latency metric: records the submission to meta
461-
// emission latency for each externalized transaction.
462-
void recordTxMetaEmissionLatency(ApplicableTxSetFrame const& txSet);
460+
// End point of the tx-latency metric: records the submission to post-apply
461+
// latency for each externalized transaction.
462+
void recordTxE2eLatency(ApplicableTxSetFrame const& txSet);
463463
#endif
464464

465465
void setState(State s);

0 commit comments

Comments
 (0)