Add percentage of memory usage to analysis summary
This commit is contained in:
parent
3f0fc63144
commit
9470c552e6
@ -226,9 +226,10 @@ function goBack() {
|
|||||||
<p>
|
<p>
|
||||||
The system has <span class="system_total_ram_kb"></span> physical memory and
|
The system has <span class="system_total_ram_kb"></span> physical memory and
|
||||||
<span class="swap_total_kb"></span> swap space. That's <span class="system_total_ramswap_kb"></span> total.
|
<span class="swap_total_kb"></span> swap space. That's <span class="system_total_ramswap_kb"></span> total.
|
||||||
<span class="system_total_ram_used_kb"></span> out of <span class="system_total_ram_kb"></span> physical
|
<span class="system_total_used_percent text--append-suffix-percent"></span>
|
||||||
memory and <span class="swap_used_kb"></span> out of <span class="swap_total_kb"></span> swap space
|
(<span class="system_total_ram_used_kb"></span> out of <span class="system_total_ram_kb"></span>) physical
|
||||||
are in use.
|
memory and <span class="system_swap_used_percent text--append-suffix-percent"></span>
|
||||||
|
(<span class="swap_used_kb"></span> out of <span class="swap_total_kb"></span>) swap space are in use.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -641,6 +641,9 @@ class OOMAnalyser(object):
|
|||||||
# SwapUsed = SwapTotal - SwapFree - SwapCache
|
# SwapUsed = SwapTotal - SwapFree - SwapCache
|
||||||
self.results['swap_used_kb'] = self.results['swap_total_kb'] - self.results['swap_free_kb'] - \
|
self.results['swap_used_kb'] = self.results['swap_total_kb'] - self.results['swap_free_kb'] - \
|
||||||
self.results['swap_cache_kb']
|
self.results['swap_cache_kb']
|
||||||
|
self.results['system_swap_used_percent'] = int(100 *
|
||||||
|
self.results['swap_total_kb'] /
|
||||||
|
self.results['swap_used_kb'])
|
||||||
|
|
||||||
def _calc_system_values(self):
|
def _calc_system_values(self):
|
||||||
"""Calculate system memory"""
|
"""Calculate system memory"""
|
||||||
@ -656,6 +659,11 @@ class OOMAnalyser(object):
|
|||||||
total_rss_pages += self.results['_processes'][pid]['rss_pages']
|
total_rss_pages += self.results['_processes'][pid]['rss_pages']
|
||||||
self.results['system_total_ram_used_kb'] = total_rss_pages * self.results['page_size_kb']
|
self.results['system_total_ram_used_kb'] = total_rss_pages * self.results['page_size_kb']
|
||||||
|
|
||||||
|
self.results['system_total_used_percent'] = int(100 *
|
||||||
|
self.results['system_total_ram_used_kb'] /
|
||||||
|
self.results['system_total_ram_kb'])
|
||||||
|
|
||||||
|
|
||||||
def _determinate_platform_and_distribution(self):
|
def _determinate_platform_and_distribution(self):
|
||||||
"""Determinate platform and distribution"""
|
"""Determinate platform and distribution"""
|
||||||
kernel_version = self.results.get('kernel_version', '')
|
kernel_version = self.results.get('kernel_version', '')
|
||||||
|
Loading…
Reference in New Issue
Block a user