summaryrefslogtreecommitdiffstats
path: root/wsd/Admin.hpp
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-08-29 11:17:39 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-08-29 12:12:08 +0530
commit65e3f7c7df67eb89ea575752fe0890c98dc29f13 (patch)
treeaf21d4478f39ac34646858a4681d8043d0082327 /wsd/Admin.hpp
parentRuler now compatible with comments and zoom (diff)
downloadonline-65e3f7c7df67eb89ea575752fe0890c98dc29f13.tar.gz
online-65e3f7c7df67eb89ea575752fe0890c98dc29f13.zip
admin: expose total available memory to admin clients
Take into reckoning the memproportion config value for total available memory to us. Change-Id: Ib93c88d746268f3e9f566beed7df77357d530eba
Diffstat (limited to 'wsd/Admin.hpp')
-rw-r--r--wsd/Admin.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/wsd/Admin.hpp b/wsd/Admin.hpp
index 16dc3363ff..3e7e0d83f6 100644
--- a/wsd/Admin.hpp
+++ b/wsd/Admin.hpp
@@ -70,6 +70,9 @@ public:
void pollingThread() override;
size_t getTotalMemoryUsage();
+ /// Takes into account the 'memproportion' property in config file to find the amount of memory
+ /// available to us.
+ size_t getTotalAvailableMemory() { return _totalAvailMem; }
size_t getTotalCpuUsage();
void modificationAlert(const std::string& dockey, Poco::Process::PID pid, bool value);
@@ -134,6 +137,7 @@ private:
uint64_t _lastSentCount;
uint64_t _lastRecvCount;
size_t _totalSysMem;
+ size_t _totalAvailMem;
std::atomic<int> _memStatsTaskIntervalMs;
std::atomic<int> _cpuStatsTaskIntervalMs;