mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Updates to load monitoring and source load tracking.
This commit is contained in:
@@ -73,8 +73,8 @@ public:
|
||||
LoadSource(const std::string& name) : mName(name), mBalance(0), mFlags(0), mLastUpdate(upTime()), mLastWarning(0)
|
||||
{ ; }
|
||||
|
||||
void rename(const std::string& name)
|
||||
{ mName = name; }
|
||||
void rename(const std::string& name) { mName = name; }
|
||||
const std::string& getName() { return mName; }
|
||||
|
||||
bool isPrivileged() const { return (mFlags & lsfPrivileged) != 0; }
|
||||
void setPrivileged() { mFlags |= lsfPrivileged; }
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
LoadManager(int creditRate = 10, int creditLimit = 50, int debitWarn = -50, int debitLimit = -100);
|
||||
LoadManager(int creditRate = 100, int creditLimit = 500, int debitWarn = -500, int debitLimit = -1000);
|
||||
~LoadManager();
|
||||
void init();
|
||||
|
||||
@@ -130,6 +130,9 @@ public:
|
||||
bool adjust(LoadSource&, int credits) const; // return value: false=balance okay, true=warn/cutoff
|
||||
bool adjust(LoadSource&, LoadType l) const;
|
||||
|
||||
void logWarning(const std::string&) const;
|
||||
void logDisconnect(const std::string&) const;
|
||||
|
||||
int getCost(LoadType t) { return mCosts[static_cast<int>(t)].mCost; }
|
||||
int getUptime();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user