mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -164,7 +164,7 @@ static bool shouldAcquire(uint32 currentLedger, uint32 ledgerHistory, uint32 can
|
||||
if (candidateLedger >= currentLedger)
|
||||
ret = true;
|
||||
else ret = (currentLedger - candidateLedger) <= ledgerHistory;
|
||||
cLog(lsDEBUG) << "Missing ledger " << candidateLedger << (ret ? "will" : "will NOT") << " be acquired";
|
||||
cLog(lsDEBUG) << "Missing ledger " << candidateLedger << (ret ? " will" : " will NOT") << " be acquired";
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,5 +87,5 @@ void LoadMonitor::getCountAndLatency(uint64& count, uint64& latencyAvg, uint64&
|
||||
latencyAvg = mLatencyMSAvg / (mLatencyEvents * 4);
|
||||
latencyPeak = mLatencyMSPeak / (mLatencyEvents * 4);
|
||||
}
|
||||
isOver = isOverTarget();
|
||||
isOver = isOverTarget(latencyAvg, latencyPeak);
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@ public:
|
||||
|
||||
void setTargetLatency(uint64 avg, uint64 pk)
|
||||
{
|
||||
mTargetLatencyAvg = avg;
|
||||
mTargetLatencyPk = pk;
|
||||
mTargetLatencyAvg = avg * 4;
|
||||
mTargetLatencyPk = pk * 4;
|
||||
}
|
||||
|
||||
bool isOverTarget()
|
||||
bool isOverTarget(uint64 avg, uint64 peak)
|
||||
{
|
||||
return (mTargetLatencyPk && (mLatencyMSPeak > mTargetLatencyPk)) ||
|
||||
(mTargetLatencyAvg && (mLatencyMSAvg > mTargetLatencyAvg));
|
||||
return (mTargetLatencyPk && (peak > mTargetLatencyPk)) ||
|
||||
(mTargetLatencyAvg && (avg > mTargetLatencyAvg));
|
||||
}
|
||||
|
||||
void getCountAndLatency(uint64& count, uint64& latencyAvg, uint64& latencyPeak, bool& isOver);
|
||||
|
||||
@@ -244,7 +244,7 @@ boost::shared_ptr<c_Data> TaggedCache<c_Key, c_Data>::fetch(const key_type& key)
|
||||
template<typename c_Key, typename c_Data>
|
||||
bool TaggedCache<c_Key, c_Data>::store(const key_type& key, const c_Data& data)
|
||||
{
|
||||
boost::shared_ptr<c_Data> d = boost::make_shared<c_Data>(boost::ref(data));
|
||||
boost::shared_ptr<c_Data> d = boost::make_shared<c_Data>(boost::cref(data));
|
||||
return canonicalize(key, d);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user