mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Track uptime. Update local fee schedule based on load manager.
This commit is contained in:
@@ -86,6 +86,9 @@ protected:
|
||||
int mDebitWarn; // when a source drops below this, we warn
|
||||
int mDebitLimit; // when a source drops below this, we cut it off (should be negative)
|
||||
|
||||
bool mShutdown;
|
||||
int mUptime;
|
||||
|
||||
mutable boost::mutex mLock;
|
||||
|
||||
void canonicalize(LoadSource&, const time_t now) const;
|
||||
@@ -94,9 +97,13 @@ protected:
|
||||
|
||||
void addLoadCost(const LoadCost& c) { mCosts[static_cast<int>(c.mType)] = c; }
|
||||
|
||||
void threadEntry();
|
||||
|
||||
public:
|
||||
|
||||
LoadManager(int creditRate = 10, int creditLimit = 50, int debitWarn = -50, int debitLimit = -100);
|
||||
~LoadManager();
|
||||
void init();
|
||||
|
||||
int getCreditRate() const;
|
||||
int getCreditLimit() const;
|
||||
@@ -113,6 +120,7 @@ public:
|
||||
bool adjust(LoadSource&, LoadType l) const;
|
||||
|
||||
int getCost(LoadType t) { return mCosts[static_cast<int>(t)].mCost; }
|
||||
int getUptime();
|
||||
};
|
||||
|
||||
class LoadFeeTrack
|
||||
|
||||
Reference in New Issue
Block a user