tdf#107278 admin console: adding graph to track CPU load

Change-Id: Idb07fe4139dd639a49ce1545cc15895f74876b06
Reviewed-on: https://gerrit.libreoffice.org/38425
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
This commit is contained in:
Aditya Dewan
2017-06-06 06:47:42 +05:30
committed by pranavk
parent 27fdb9b864
commit 9502741590
10 changed files with 282 additions and 88 deletions

View File

@ -54,6 +54,7 @@ public:
_pid(pid),
_filename(filename),
_memoryDirty(0),
_lastJiffy(0),
_start(std::time(nullptr)),
_lastActivity(_start),
_sentBytes(0),
@ -77,6 +78,9 @@ public:
unsigned getActiveViews() const { return _activeViews; }
unsigned getLastJiffies() const { return _lastJiffy; }
void setLastJiffies(size_t newJ) { _lastJiffy = newJ; }
const std::map<std::string, View>& getViews() const { return _views; }
void updateLastActivityTime() { _lastActivity = std::time(nullptr); }
@ -110,6 +114,8 @@ private:
std::string _filename;
/// The dirty (ie. un-shared) memory of the document's Kit process.
int _memoryDirty;
/// Last noted Jiffy count
unsigned _lastJiffy;
std::time_t _start;
std::time_t _lastActivity;
@ -184,6 +190,7 @@ public:
/// Returns memory consumed by all active loolkit processes
unsigned getKitsMemoryUsage();
size_t getKitsJiffies();
void subscribe(int sessionId, const std::weak_ptr<WebSocketHandler>& ws);
void subscribe(int sessionId, const std::string& command);