Merge branch 'master' of github.com:jedmccaleb/NewCoin

This commit is contained in:
Arthur Britto
2012-12-06 07:38:11 -08:00
4 changed files with 8 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);
}