mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Replace UptimeTimer with UptimeClock
* UptimeClock is a chrono-compatible seconds-precision clock. * Like UptimeTimer, its purpose is to make it possible for clients to query the uptime thousands of times per second without a significant performance hit. * UptimeClock decouples itself from LoadManager by managing its own once-per-second update loop. * Clients now traffic in chrono time_points and durations instead of int.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/TaggedCache.h>
|
||||
#include <ripple/basics/UptimeTimer.h>
|
||||
#include <ripple/basics/UptimeClock.h>
|
||||
#include <ripple/core/TimeKeeper.h>
|
||||
#include <ripple/nodestore/DatabaseShard.h>
|
||||
#include <ripple/overlay/Overlay.h>
|
||||
@@ -1792,9 +1792,9 @@ LedgerMaster::makeFetchPack (
|
||||
std::weak_ptr<Peer> const& wPeer,
|
||||
std::shared_ptr<protocol::TMGetObjectByHash> const& request,
|
||||
uint256 haveLedgerHash,
|
||||
std::uint32_t uUptime)
|
||||
UptimeClock::time_point uptime)
|
||||
{
|
||||
if (UptimeTimer::getInstance ().getElapsedSeconds () > (uUptime + 1))
|
||||
if (UptimeClock::now() > uptime + 1s)
|
||||
{
|
||||
JLOG(m_journal.info()) << "Fetch pack request got stale";
|
||||
return;
|
||||
@@ -1916,7 +1916,7 @@ LedgerMaster::makeFetchPack (
|
||||
wantLedger = getLedgerByHash (haveLedger->info().parentHash);
|
||||
}
|
||||
while (wantLedger &&
|
||||
UptimeTimer::getInstance ().getElapsedSeconds () <= uUptime + 1);
|
||||
UptimeClock::now() <= uptime + 1s);
|
||||
|
||||
JLOG(m_journal.info())
|
||||
<< "Built fetch pack with " << reply.objects ().size () << " nodes";
|
||||
|
||||
Reference in New Issue
Block a user