Display "<not found>" for all values that are not part of the OOM

This commit is contained in:
Carsten Grohmann 2018-04-15 20:54:24 +02:00
parent e29bf05efd
commit 3e6d4c8662
2 changed files with 18 additions and 2 deletions

View File

@ -30,6 +30,10 @@
content: " pages"; content: " pages";
} }
.notfound {
text-align: right;
}
table { table {
border-collapse: collapse; border-collapse: collapse;
padding: 10px; padding: 10px;

View File

@ -462,6 +462,15 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
if isinstance(content, str): if isinstance(content, str):
content = content.strip() content = content.strip()
element.textContent = content element.textContent = content
if content == '<not found>':
element.classList.remove('kbytes', 'pages')
element.classList.add('notfound')
elif item.endswith('_kb'):
element.classList.add('kbytes')
elif item.endswith('_pages'):
element.classList.add('pages')
if DEBUG: if DEBUG:
show_element('notify_box') show_element('notify_box')
@ -663,10 +672,13 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k
# convert all *_pages and *_kb to integer # convert all *_pages and *_kb to integer
for item in self.details.keys(): for item in self.details.keys():
if item.endswith('_kb') or item.endswith('_pages'): if item.endswith('_kb') or item.endswith('_pages'):
if self.details[item] is None:
self.details[item] = '<not found>'
continue
try: try:
self.details[item] = int(self.details[item]) self.details[item] = int(self.details[item])
except BaseException: except:
error('Converting item {}: {} to integer failed'. format(item, self.details[item])) error('Converting item {}: {} to integer failed'.format(item, self.details[item]))
kernel_version = self.details.get('kernel_version', '') kernel_version = self.details.get('kernel_version', '')
if 'x86_64' in kernel_version: if 'x86_64' in kernel_version: