mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Load types.
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
#include "LoadManager.h"
|
||||
|
||||
LoadManager::LoadManager(int creditRate, int creditLimit, int debitWarn, int debitLimit) :
|
||||
mCreditRate(creditRate), mCreditLimit(creditLimit), mDebitWarn(debitWarn), mDebitLimit(debitLimit)
|
||||
{
|
||||
addLoadCost(LoadCost(LT_InvalidRequest, 10, LC_CPU | LC_Network));
|
||||
addLoadCost(LoadCost(LT_RequestNoReply, 1, LC_CPU | LC_Disk));
|
||||
addLoadCost(LoadCost(LT_InvalidSignature, 100, LC_CPU));
|
||||
addLoadCost(LoadCost(LT_UnwantedData, 5, LC_CPU | LC_Network));
|
||||
|
||||
addLoadCost(LoadCost(LT_NewTrusted, 10, 0));
|
||||
addLoadCost(LoadCost(LT_NewTransaction, 2, 0));
|
||||
addLoadCost(LoadCost(LT_NeededData, 10, 0));
|
||||
|
||||
addLoadCost(LoadCost(LT_RequestData, 5, LC_Disk | LC_Network));
|
||||
addLoadCost(LoadCost(LT_CheapQuery, 1, LC_CPU));
|
||||
}
|
||||
|
||||
|
||||
int LoadManager::getCreditRate() const
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
|
||||
Reference in New Issue
Block a user