Commit Graph

164 Commits

Author SHA1 Message Date
Carsten Grohmann
b8a858dba3 Remove obsolete comment lines 2021-10-25 22:06:41 +02:00
Carsten Grohmann
aa28e0bb7c Hide "OOM Score" if not available 2021-10-25 22:06:17 +02:00
Carsten Grohmann
f95899d7d5 Fix detecting Ubuntu 2021-10-23 20:43:12 +02:00
Carsten Grohmann
5b9a4712e2 Add support for newer kernels
Suggested-by: Mikko Rantalainen <mikko.rantalainen@gmail.com>
2021-10-23 20:29:49 +02:00
Carsten Grohmann
fd3372b54b Filter out non-existent elements from SVG making 2021-10-20 21:32:57 +02:00
Carsten Grohmann
c8a6f74d03 Move more configuration to class BaseKernelConfig 2021-10-09 23:22:12 +02:00
Carsten Grohmann
c1a5ed3420 Add support for systems w/o swap
Suggested-by: Mikko Rantalainen <mikko.rantalainen@gmail.com>
2021-10-09 22:06:16 +02:00
Carsten Grohmann
8ed7678a74 Add support for manually triggered OOM
Suggested-by: Mikko Rantalainen <mikko.rantalainen@gmail.com>
2021-10-04 20:46:43 +02:00
Carsten Grohmann
7af0c1d7e8 Restructure code to analyse OOM
This code changes should simplify future extension of the analysis and
calculation code.
2021-09-27 21:06:47 +02:00
Carsten Grohmann
f0b4ac895c Extend JS MOC objects 2021-09-20 20:21:39 +02:00
Carsten Grohmann
cce4d65c4f Escape special characters in notification box 2021-09-14 20:23:56 +02:00
Carsten Grohmann
6528b96adb Restructure regex for better error messages 2021-09-14 20:19:32 +02:00
Carsten Grohmann
dd8b806bd3 Use different color set for swap usage diagram 2021-09-12 13:37:54 +02:00
Carsten Grohmann
022a5977fc Use SVG <use/> to show small triangular icons 2021-07-29 02:39:59 +02:00
Carsten Grohmann
9a5dbbc255 Fix the order of processing #012/LF
Remove unnecessary columns first and unwind #012 (octal replacement of
LF) second. Otherwise, important content would be lost.
2021-07-29 02:28:16 +02:00
Carsten Grohmann
08f7669654 Simplify code to unwind #012/LF 2021-07-29 02:28:00 +02:00
Carsten Grohmann
cd832461b6 Add tooltips to memory SVGs 2021-07-25 08:42:39 +02:00
Carsten Grohmann
41a51a7e2a Rework removal of unused information
The columns left to the oom are not used. With this change, the
algorithm becomes more robust and can better handle known special
cases like "kernel:<processname>".
2021-07-24 00:28:38 +02:00
Carsten Grohmann
c9b665b464 Rework extracting a block from the OOM 2021-07-21 21:43:16 +02:00
Carsten Grohmann
e859317685 Show a warning if a RE finds nothing 2021-07-21 21:06:20 +02:00
Carsten Grohmann
000b6635ec Typos 2021-07-21 21:04:11 +02:00
Carsten Grohmann
e283ff2019 Fix to allow process names with spaces 2021-07-18 14:29:40 +02:00
Carsten Grohmann
1f087b7cd9 Change killed process from java to mysqld
The process has been renamed to use a one-to-one name. This makes it
easier to change the name in a test case.
2021-07-18 14:17:07 +02:00
Carsten Grohmann
04002ab6e6 Extent unit tests 2021-07-17 22:36:04 +02:00
Carsten Grohmann
6858d09eda Rename two variables to prevent shadowing
Shadowing isn't the problem here, but IDEs checker is complaining ...
2021-07-12 20:56:14 +02:00
Carsten Grohmann
b720297b89 Improve SVG chart colour palette 2021-07-11 22:02:29 +02:00
Carsten Grohmann
98c99fa57f Update copyright years 2021-02-05 17:04:09 +01:00
Carsten Grohmann
d4a90ec1bb Start new development cycle 2020-12-10 13:57:33 +01:00
Carsten Grohmann
6af2e7cba9 Bump version number to 0.4.0 2020-12-10 13:51:39 +01:00
Carsten Grohmann
d964d657ba Allow all non-whitespace chars in program names
Program names in Posix can contain all characters expect the null byte.
The code allows \S (all non-whitespaces) and spaces in program names.
This excluded some allowed characters like \n, \r and \t. No negative
effects should arise from this.
2020-12-07 14:00:20 +01:00
Carsten Grohmann
967d231be5 Use transcrypt --sform to enable string formatting
The Python string formatting mini language isn't enabled by default.
"{}".format(42) works fine but "{0:x}.format(42)" returns "{0:x}"
instead of "2a" if the mini language isn't enabled.
2020-11-20 21:51:33 +01:00
Carsten Grohmann
c55a4d018e Pressing "Reset" cleans the text area also 2020-11-20 10:28:21 +01:00
Carsten Grohmann
674ea295a8 Line "Killed process" can contain the process UID
Newer Red Hat 7 releases changes the output of the OOM a little bit. The
last output line "Killed process" contains the process UID now.

Old:
    Killed process 6576 (java) total-vm:33914892kB, \
    anon-rss:20629004kB, file-rss:0kB, shmem-rss:0kB

New:
    Killed process 6576 (java), UID 12345, total-vm:33914892kB, \
    anon-rss:20629004kB, file-rss:0kB, shmem-rss:0kB
2020-11-19 14:58:39 +01:00
Carsten Grohmann
cceb2fa21e Process names can contains - signs also
Valid process names can consist of \w ([a-zA-Z0-9_]), minus and spaces.
2020-11-19 14:50:01 +01:00
Carsten Grohmann
b2b5a1b1db Move GFP flags to class KernelConfig 2020-10-31 14:45:32 +01:00
Carsten Grohmann
2d55b800dc Unify ps table column names in class KernelConfig 2020-10-31 14:40:02 +01:00
Carsten Grohmann
26610a709e Pep8 2020-10-30 20:58:57 +01:00
Carsten Grohmann
0bc541ff11 Prefix CSS class mem-usage__svg with js-
This class is used within JS code.
2020-10-30 14:14:03 +01:00
Carsten Grohmann
468991a31b Use textarea placeholder instead of own code
<textarea placeholder="..."> is more simple that writing own code.
Thereby the own code / logic has been removed.
2020-07-15 21:10:37 +02:00
Carsten Grohmann
230cddae19 Fix: Trigger process isn't part of process table 2020-07-15 20:43:44 +02:00
Carsten Grohmann
d670dbef45 Use class instead of type selector
for memory usage diagrams. This allows a better separation between
different SVG usages.
2020-04-07 17:26:29 +02:00
Carsten Grohmann
a8772ab94e Remove unused code 2020-04-07 14:52:59 +02:00
Carsten Grohmann
7b80e1b23a Bad indentation and tailing whitespaces 2020-04-07 14:51:34 +02:00
Carsten Grohmann
23f064f2b7 Add sorting process table 2020-04-05 14:28:37 +02:00
Carsten Grohmann
54e4f566a4 Replace plain text process table by an HTML table
and mark the trigger process and the killed process.
2020-03-26 13:46:20 +01:00
Carsten Grohmann
da77369418 Convert score automatically to integer
Convert killed_proc_score and trigger_proc_oomscore to integer values
2020-02-04 20:30:11 +01:00
Carsten Grohmann
1ac0bd8fe9 Don't clean elements when set back to defaults
The elements are not shown, thereby a cleanup isn't necessary. When the
elements are shown again, new values are set and overwrite the old one.
2020-02-03 21:22:44 +01:00
Carsten Grohmann
ff725e9235 Fix issue that prevents units from being copied
Units have been placed with the ::after selector. Content showing with
this pseudo-element can't be selected and copied.

Now the units are automatically added when the value is set.
2020-02-03 21:15:47 +01:00
Carsten Grohmann
527eaa4cf6 Use classes selectors to simplify handling 2020-02-03 06:18:40 +01:00
Carsten Grohmann
9470c552e6 Add percentage of memory usage to analysis summary 2020-01-31 22:10:11 +01:00
Carsten Grohmann
27e811979c Add suffix "_pages" to process table items 2020-01-09 06:28:34 +01:00
Carsten Grohmann
13afe5247b Rollback changed interpretation of last OOM line
This is a logical rollback because I was wrong about the
interpretation of this line.
2020-01-08 20:59:20 +01:00
Carsten Grohmann
3dc965e8ff Set a single value to several places
Prior this change items are set to html elements with id of the same
name. Now OOMDisplay._set_item() searches for elements with same-named
id or with item name listed in class attribute.

This allows to set one value to several places to once.

Additional suffixes for pages and kbytes are added in the singular or
plural automatically.
2020-01-06 22:11:51 +01:00
Carsten Grohmann
fe3aed9815 Fix calculation of requested memory in kBytes 2020-01-05 01:12:58 +01:00
Carsten Grohmann
cd00996583 Rename item according to the naming convention 2020-01-05 01:10:35 +01:00
Carsten Grohmann
374cc2e910 Fix interpretation of the last OOM line
The memory statistics in the last OOM line (total-vm, anon-rss,
file-rss, shmem-rss) are overall and not related to the killed process.
2020-01-05 01:00:02 +01:00
Carsten Grohmann
85308f6d03 Typos 2020-01-05 00:52:13 +01:00
Carsten Grohmann
5b384a4d8f Add a textual summary of the analysis 2020-01-04 14:25:41 +01:00
Carsten Grohmann
a8344d3656 Update copyright years 2020-01-02 20:58:01 +01:00
Carsten Grohmann
606d0d6769 Use negative slicing with operator overloading
Positive numbers in slices works well, but for negative numbers you
have to activate operator overloading. This has a (unknown) speed
penalty.
2019-12-03 06:54:27 +01:00
Carsten Grohmann
dfcbe56fa6 Start new development cycle 2019-12-03 06:49:44 +01:00
Carsten Grohmann
281d7f4258 Bump version number to 0.3.0 2019-11-24 11:00:08 +01:00
Carsten Grohmann
0d0fe27fca Prefix CSS classes text--default* with js-
These classes are used within JS code to control the visibility during
the web page will set to the default.
2019-11-24 10:23:57 +01:00
Carsten Grohmann
6f1245bd15 Show h2 headline in TOC only if id attr is set
There are two conditions to show a h2 headline in TOC:
 * the headline is visible
 * the id attribute is set

Thereby the css style js-flag-hide-from-toc won't be used anymore.
2019-11-21 08:14:12 +01:00
Carsten Grohmann
9d9e1d9d6e Add to the right an automatically generated TOC 2019-11-16 10:53:07 +01:00
Carsten Grohmann
9e35bf8596 Use a better describung name for class OOMState
and rename it to OOMEntityState
2019-11-14 06:31:00 +01:00
Carsten Grohmann
58f06caede Use return value from OOMAnalyser.analyse() directly 2019-11-13 20:57:25 +01:00
Carsten Grohmann
b0abc7f3c0 Empty results for new extract run 2019-11-13 20:52:12 +01:00
Carsten Grohmann
138022beae Use CSS to show/hide elements in default view 2019-11-13 20:48:44 +01:00
Carsten Grohmann
824e8365e6 Clarify comment in OOMDisplay.analyse_and_show() 2019-11-13 06:39:37 +01:00
Carsten Grohmann
5305326069 Use a better describing name for OOMAnalyser.oom 2019-11-12 21:05:42 +01:00
Carsten Grohmann
adeaef5161 Use a better describing name for class OOM 2019-11-12 21:02:30 +01:00
Carsten Grohmann
6a8b484006 Add check/state for empty an OOM block 2019-11-12 20:50:07 +01:00
Carsten Grohmann
1c2290b371 Add an enum to track the completeness of an OOM 2019-11-12 20:42:06 +01:00
Carsten Grohmann
217a0f9ee4 Clear the OOM textarea if it gets the focus
Clear the area onfocusin only if this just contains the usage hint.
2019-11-05 20:45:55 +01:00
Carsten Grohmann
f8cc21809b Eliminate duplicate statement to hide notifications 2019-11-05 20:31:18 +01:00
Carsten Grohmann
9fc006e227 Eliminate duplicate code to show the notification box 2019-11-05 20:29:02 +01:00
Carsten Grohmann
5140713c99 Unescape line feeds escaped by rsyslog 2019-11-04 21:04:23 +01:00
Carsten Grohmann
c2199bc029 Ignore elements w/o values in SVG generation
If the OOM format has changed and the regular expression doesn't match,
the values are None (js: undefined). Ignore such values now.
2019-11-02 21:19:04 +01:00
Carsten Grohmann
23b33e3763 Strip columns left to the message automatically
Just count the columns leftside of the OOM message instead of defining
their format/content and position.

This is more flexible.
2019-11-01 21:38:34 +01:00
Carsten Grohmann
7e637aa3f8 Update date format regex
This regex will be used to cut off the leading timestamp.
2019-10-30 21:46:26 +01:00
Carsten Grohmann
ea2e674998 Update copyright years 2019-02-07 20:52:37 +01:00
Carsten Grohmann
dd75da31c0 Move distribution guessing into own function 2018-11-08 20:53:52 +01:00
Carsten Grohmann
b7ca1fdec5 Add kernel signature for Oracle Linux 7 UEK 2018-11-08 20:46:05 +01:00
Carsten Grohmann
f1591ed8f9 Don't add suffixes "kBytes" and "pages" twice 2018-10-16 19:59:46 +02:00
Carsten Grohmann
5a89d46034 Use CSS classes to control the visibility 2018-10-16 19:50:33 +02:00
Carsten Grohmann
32126bf735 Use better names for CSS selectors 2018-10-13 19:00:09 +02:00
Carsten Grohmann
2dac4e2c48 Rename OOMAnalyser.details to OOMAnalyser.results 2018-09-11 19:55:29 +02:00
Carsten Grohmann
c6c2361310 Remove redundant character escape in RE 2018-09-11 19:51:01 +02:00
Carsten Grohmann
85a82a4770 Separate analysis and visualisation
Extract code to display details from code to analyse/split the OOM.
This should simplify later extensions as well as later written unit
tests.
2018-09-11 19:49:39 +02:00
Carsten Grohmann
ffd77573d6 Use a more speaking name for the index in OOM class 2018-08-27 20:02:06 +02:00
Carsten Grohmann
8764399e2b Update docstrings 2018-08-27 19:58:43 +02:00
Carsten Grohmann
d03db8f8ad Bump version number to 0.2.0 2018-08-12 14:22:55 +02:00
Carsten Grohmann
e34c5ab909 Show the requested memory additionally in kBytes
Till now the requested memory has been shown in pages only.
2018-08-12 14:18:09 +02:00
Carsten Grohmann
d7456383a2 Hide full OOM message at and of the table
Since all elements are extracted and shown already. The original OOM
text is faded out. Click to notice next by the head line to expand
the full message again.
2018-08-12 13:34:24 +02:00
Carsten Grohmann
ae7ace8798 Use pragma 'jsiter' to write more pythonic code 2018-08-10 21:03:30 +02:00
Carsten Grohmann
08fa63010c Analyse the complete line "invoked oom-killer"
Analyse and show the GFP mask, the nodemask (is available), the
number of requested pages (order) and the adjusted OOM score.
2018-08-08 20:41:26 +02:00
Carsten Grohmann
2cdd3a98ed Change handling of not found elements 2018-05-06 11:01:40 +02:00
Carsten Grohmann
e3558a911f Hide table rows w/o values instead of showing "<not found>" 2018-04-16 21:06:20 +02:00
Carsten Grohmann
0b3beb07c6 Merge handling of regular expressions using the same pattern 2018-04-15 21:07:14 +02:00