diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-02-03 01:29:53 -0500 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2017-02-03 07:12:31 +0000 |
commit | d7a9a76ddbd0590542b6c0f765c31d7af9fe09c4 (patch) | |
tree | 98ef9e0756790261957522365da681cfa362907e /wsd/AdminModel.hpp | |
parent | wsd: access AdminModel instance under lock (diff) | |
download | online-d7a9a76ddbd0590542b6c0f765c31d7af9fe09c4.tar.gz online-d7a9a76ddbd0590542b6c0f765c31d7af9fe09c4.zip |
wsd: report PSS of kit processes
Each Kit process now reports its own PSS,
which is much more accurate as they share
a significant ratio of their pages with
one another.
Admin tracks the PSS values of the Kits
and reports to the console.
Change-Id: Ifa66d17749c224f0dc211db80c44f7c913f2d6c4
Reviewed-on: https://gerrit.libreoffice.org/33864
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
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; |