diff options
Diffstat (limited to 'wsd/AdminModel.hpp')
-rw-r--r-- | wsd/AdminModel.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/wsd/AdminModel.hpp b/wsd/AdminModel.hpp index 1251470c94..0e46ca568b 100644 --- a/wsd/AdminModel.hpp +++ b/wsd/AdminModel.hpp @@ -49,6 +49,7 @@ public: : _docKey(docKey), _pid(pid), _filename(filename), + _memoryPss(0), _start(std::time(nullptr)), _lastActivity(_start) { @@ -73,6 +74,8 @@ public: const std::map<std::string, View>& getViews() const { return _views; } void updateLastActivityTime() { _lastActivity = std::time(nullptr); } + void updateMemoryPss(int pss) { _memoryPss = pss; } + int getMemoryPss() const { return _memoryPss; } private: const std::string _docKey; @@ -83,6 +86,8 @@ private: unsigned _activeViews = 0; /// Hosted filename std::string _filename; + /// The PSS of the document's Kit process. + int _memoryPss; std::time_t _start; std::time_t _lastActivity; @@ -173,6 +178,7 @@ public: void removeDocument(const std::string& docKey); void updateLastActivityTime(const std::string& docKey); + void updateMemoryPss(const std::string& docKey, int pss); private: std::string getMemStats(); @@ -187,6 +193,7 @@ private: std::map<int, Subscriber> _subscribers; std::map<std::string, Document> _documents; + /// The last N total memory PSS. std::list<unsigned> _memStats; unsigned _memStatsSize = 100; |