javacore-analyser 2.0rc1__py3-none-any.whl → 2.1.0.dev66__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- javacore_analyser/abstract_snapshot_collection.py +2 -2
- javacore_analyser/constants.py +2 -1
- javacore_analyser/data/expand.js +2 -0
- javacore_analyser/data/html/processing_data.html +17 -0
- javacore_analyser/data/jquery/search.js +22 -0
- javacore_analyser/data/jquery/wait2scripts.js +27 -5
- javacore_analyser/data/xml/javacores/javacore.xsl +126 -117
- javacore_analyser/data/xml/report.xsl +1 -1
- javacore_analyser/data/xml/threads/thread.xsl +162 -153
- javacore_analyser/javacore.py +5 -3
- javacore_analyser/javacore_analyser_batch.py +34 -14
- javacore_analyser/javacore_analyser_web.py +58 -26
- javacore_analyser/javacore_set.py +78 -43
- javacore_analyser/snapshot_collection_collection.py +5 -3
- javacore_analyser/stack_trace.py +2 -2
- javacore_analyser/stack_trace_element.py +1 -1
- javacore_analyser/templates/index.html +9 -4
- javacore_analyser/thread_snapshot.py +3 -2
- javacore_analyser/tips.py +5 -3
- javacore_analyser/verbose_gc.py +4 -1
- {javacore_analyser-2.0rc1.dist-info → javacore_analyser-2.1.0.dev66.dist-info}/METADATA +25 -15
- javacore_analyser-2.1.0.dev66.dist-info/RECORD +45 -0
- {javacore_analyser-2.0rc1.dist-info → javacore_analyser-2.1.0.dev66.dist-info}/WHEEL +1 -1
- javacore_analyser-2.0rc1.dist-info/RECORD +0 -44
- {javacore_analyser-2.0rc1.dist-info → javacore_analyser-2.1.0.dev66.dist-info}/entry_points.txt +0 -0
- {javacore_analyser-2.0rc1.dist-info → javacore_analyser-2.1.0.dev66.dist-info}/licenses/LICENSE +0 -0
@@ -59,7 +59,7 @@ class AbstractSnapshotCollection(abc.ABC):
|
|
59
59
|
self.thread_snapshots.append(snapshot)
|
60
60
|
|
61
61
|
def index_of(self, snapshot):
|
62
|
-
for i in range(len(self.
|
62
|
+
for i in range(len(self.thread_snapshots)):
|
63
63
|
if self.thread_snapshots[i] == snapshot: return i
|
64
64
|
return -1
|
65
65
|
|
@@ -142,7 +142,7 @@ class AbstractSnapshotCollection(abc.ABC):
|
|
142
142
|
result = 0
|
143
143
|
for i in self.thread_snapshots:
|
144
144
|
el = i.get_java_stack_depth()
|
145
|
-
if el>result:
|
145
|
+
if el > result:
|
146
146
|
result = el
|
147
147
|
return result
|
148
148
|
|
javacore_analyser/constants.py
CHANGED
@@ -30,10 +30,11 @@ ENCODING = '1TICHARSET'
|
|
30
30
|
DATA_OUTPUT_SUBDIR = '/data/'
|
31
31
|
DEFAULT_FILE_DELIMITER = ';'
|
32
32
|
|
33
|
-
MIN_JAVACORE_SIZE = 5 * 1024
|
33
|
+
MIN_JAVACORE_SIZE = 5 * 1024 # Minimal Javacore size in bytes
|
34
34
|
|
35
35
|
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
36
36
|
|
37
37
|
# Web application constants
|
38
38
|
DEFAULT_REPORTS_DIR = "reports"
|
39
39
|
DEFAULT_PORT = 5000
|
40
|
+
TEMP_DIR = "temp_data" # Folder to store temporary data for creating reports
|
javacore_analyser/data/expand.js
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<!--
|
4
|
+
# Copyright IBM Corp. 2024 - 2024
|
5
|
+
# SPDX-License-Identifier: Apache-2.0
|
6
|
+
-->
|
7
|
+
|
8
|
+
<html lang="en">
|
9
|
+
<head>
|
10
|
+
<meta http-equiv="refresh" content="30" /> <!-- Refresh this page every 30s until generated page appears -->
|
11
|
+
<meta charset="UTF-8">
|
12
|
+
<title>The page is being generated</title>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<h1>The page is being generated. Once it is ready, it will appear here.</h1>
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -49,10 +49,32 @@ $(function() {
|
|
49
49
|
searchInNode(rootNode, searchTerm);
|
50
50
|
}
|
51
51
|
|
52
|
+
function processChild(child) {
|
53
|
+
try {
|
54
|
+
if (isDomNode(child) && child.classList.contains('toggle_expand')) {
|
55
|
+
for (i = 0; i < child.childNodes.length; ++i) {
|
56
|
+
grandchild = child.childNodes[i];
|
57
|
+
if (isDomNode(grandchild) && grandchild.text == '[+] Expand') {
|
58
|
+
grandchild.text = '[-] Collapse';
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
} catch(err) {
|
63
|
+
console.log(err);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
52
67
|
function searchInNode(node, searchTerm) {
|
53
68
|
if (!isDomNode(node)) return;
|
54
69
|
if (node.textContent.toUpperCase().match(searchTerm.toUpperCase())) {
|
55
70
|
// expand the node here
|
71
|
+
if (!node.classList.contains('show-all')) {
|
72
|
+
node.classList.add('show-all');
|
73
|
+
for (i = 0; i < node.childNodes.length; ++i) {
|
74
|
+
child = node.childNodes[i];
|
75
|
+
processChild(child);
|
76
|
+
}
|
77
|
+
}
|
56
78
|
if (node.getAttribute('style') && node.style.display == "none") {
|
57
79
|
node.style.display = "";
|
58
80
|
}
|
@@ -145,12 +145,34 @@ const loadChartGC = function() {
|
|
145
145
|
});
|
146
146
|
|
147
147
|
// 3. find the HEAP_SIZE
|
148
|
-
const MB_SIZE = Math.pow(1024, 2)
|
148
|
+
const MB_SIZE = Math.pow(1024, 2);
|
149
|
+
let heapAsString = document.getElementById('sys_info_table').rows[2].cells[1].innerHTML;
|
149
150
|
let HEAP_SIZE;
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
151
|
+
let heapUnit = heapAsString.slice(-1).toLowerCase();
|
152
|
+
|
153
|
+
if(!isNaN(Number(heapUnit))) {
|
154
|
+
HEAP_SIZE = Number(heapAsString);
|
155
|
+
}
|
156
|
+
else {
|
157
|
+
|
158
|
+
switch (heapUnit) {
|
159
|
+
case "g":
|
160
|
+
HEAP_SIZE =
|
161
|
+
Number(heapAsString.slice(0, -1)) * MB_SIZE * 1024;
|
162
|
+
break;
|
163
|
+
case "m":
|
164
|
+
HEAP_SIZE =
|
165
|
+
Number(heapAsString.slice(0, -1)) * MB_SIZE;
|
166
|
+
break;
|
167
|
+
case "k":
|
168
|
+
HEAP_SIZE =
|
169
|
+
Number(heapAsString.slice(0, -1)) * 1024;
|
170
|
+
break;
|
171
|
+
default:
|
172
|
+
console.log("Hmm, what now .. heap unit undefined!");
|
173
|
+
break;
|
174
|
+
}
|
175
|
+
}
|
154
176
|
|
155
177
|
// 4. create input data for GC chart
|
156
178
|
// start with gc collection done after the first javacore creation
|
@@ -20,139 +20,148 @@
|
|
20
20
|
<script type="text/javascript" src="../data/jquery/wait2scripts.js"> _ </script>
|
21
21
|
<script type="text/javascript" src="../data/jquery/sorting.js"> _ </script>
|
22
22
|
<script type="text/javascript" src="../data/expand.js"> _ </script>
|
23
|
-
|
24
|
-
|
23
|
+
<script src="../data/jquery/jquery.mark.min.js"> _ </script>
|
24
|
+
<script type="text/javascript" src="../data/jquery/search.js"> _ </script>
|
25
25
|
</head>
|
26
26
|
|
27
27
|
<body id="doc_body" height="100%">
|
28
|
-
<
|
29
|
-
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
</thead>
|
42
|
-
<tbody>
|
43
|
-
<xsl:for-each select="//Thread/all_snapshot_collection/snapshot_collection/stack[file_name='{id}']">
|
44
|
-
<xsl:variable name="i" select="position()" />
|
28
|
+
<div class="searchbar">
|
29
|
+
<input id="search-input" type="search" />
|
30
|
+
<button data-search="search" id="search-button">Search</button>
|
31
|
+
<button data-search="next">Next</button>
|
32
|
+
<button data-search="prev">Prev</button>
|
33
|
+
<button data-search="clear">✖</button>
|
34
|
+
</div>
|
35
|
+
<div class="content">
|
36
|
+
<p class="right"><a href="../index.html"> Back to Main page </a></p>
|
37
|
+
<h2>Wait Report for: <b>{id}</b></h2>
|
38
|
+
<div id="all_threads">
|
39
|
+
<table id="javacore_threads_table" class="tablesorter_blue">
|
40
|
+
<thead>
|
45
41
|
<tr>
|
46
|
-
<
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
42
|
+
<th class="sixty">Thread name</th>
|
43
|
+
<th>Total CPU usage (s)</th>
|
44
|
+
<th>% CPU usage</th>
|
45
|
+
<th>Memory allocated since last GC (MB)</th>
|
46
|
+
<th>Java stack depth</th>
|
47
|
+
<th>Status</th>
|
48
|
+
</tr>
|
49
|
+
</thead>
|
50
|
+
<tbody>
|
51
|
+
<xsl:for-each select="//Thread/all_snapshot_collection/snapshot_collection/stack[file_name='{id}']">
|
52
|
+
<xsl:variable name="i" select="position()" />
|
53
|
+
<tr>
|
54
|
+
<td class="left">
|
55
|
+
<div>
|
56
|
+
<xsl:attribute name="id">
|
57
|
+
<xsl:value-of select="concat('stack',$i)"/>
|
54
58
|
</xsl:attribute>
|
55
|
-
<
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
<a target="_blank">
|
60
|
+
<xsl:attribute name="href">
|
61
|
+
<xsl:value-of select="concat('../threads/thread_', thread_hash, '.html')"/>
|
62
|
+
</xsl:attribute>
|
63
|
+
<xsl:value-of select="thread_name"/>
|
64
|
+
</a>
|
65
|
+
<xsl:choose>
|
66
|
+
<xsl:when test="stack_depth > 0">
|
67
|
+
<div>
|
68
|
+
<div class="toggle_expand">
|
69
|
+
<a href="javaScript:;" class="show">[+] Expand</a> <!-- "show" class is used in expand.js -->
|
70
|
+
</div>
|
71
|
+
<p class="stacktrace">
|
72
|
+
<xsl:for-each select="*[starts-with(name(), 'line')]">
|
73
|
+
<span>
|
74
|
+
<xsl:attribute name="class">
|
75
|
+
<xsl:value-of select="@kind"/>
|
76
|
+
</xsl:attribute>
|
77
|
+
<xsl:value-of select="current()"/>
|
78
|
+
</span>
|
79
|
+
<br/>
|
80
|
+
</xsl:for-each>
|
81
|
+
</p>
|
62
82
|
</div>
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
</div>
|
83
|
+
</xsl:when>
|
84
|
+
<xsl:otherwise>
|
85
|
+
No stack
|
86
|
+
</xsl:otherwise>
|
87
|
+
</xsl:choose>
|
88
|
+
</div>
|
89
|
+
</td>
|
90
|
+
<td>
|
91
|
+
<xsl:choose>
|
92
|
+
<xsl:when test="cpu_usage >= 0">
|
93
|
+
<xsl:value-of select='format-number(cpu_usage, "0.00")'/>
|
75
94
|
</xsl:when>
|
76
95
|
<xsl:otherwise>
|
77
|
-
|
96
|
+
<div class="warning">[!]
|
97
|
+
<span class="warningtooltip">Error computing CPU usage, javacores may be corrupted</span>
|
98
|
+
</div>
|
78
99
|
</xsl:otherwise>
|
79
100
|
</xsl:choose>
|
80
|
-
</
|
81
|
-
|
82
|
-
<td>
|
83
|
-
<xsl:choose>
|
84
|
-
<xsl:when test="cpu_usage >= 0">
|
85
|
-
<xsl:value-of select='format-number(cpu_usage, "0.00")'/>
|
86
|
-
</xsl:when>
|
87
|
-
<xsl:otherwise>
|
88
|
-
<div class="warning">[!]
|
89
|
-
<span class="warningtooltip">Error computing CPU usage, javacores may be corrupted</span>
|
90
|
-
</div>
|
91
|
-
</xsl:otherwise>
|
92
|
-
</xsl:choose>
|
93
|
-
</td>
|
94
|
-
<td>
|
95
|
-
<xsl:choose>
|
96
|
-
<xsl:when test="cpu_percentage >= 0">
|
97
|
-
<xsl:value-of select='format-number(cpu_percentage, "0.0")'/>
|
98
|
-
</xsl:when>
|
99
|
-
<xsl:otherwise>
|
100
|
-
<div class="warning">[!]
|
101
|
-
<span class="warningtooltip">Error computing CPU percentage, javacores may be corrupted</span>
|
102
|
-
</div>
|
103
|
-
</xsl:otherwise>
|
104
|
-
</xsl:choose>
|
105
|
-
</td>
|
106
|
-
<td><xsl:value-of select='format-number(allocated_memory div 1024 div 1024, "0.00")'/></td>
|
107
|
-
<td><xsl:value-of select='java_stack_depth'/></td>
|
108
|
-
<xsl:choose>
|
109
|
-
<xsl:when test="state='CW'">
|
110
|
-
<td class="waiting">Waiting on condition</td>
|
111
|
-
</xsl:when>
|
112
|
-
<xsl:when test="state='R'">
|
113
|
-
<td class="runnable">Runnable</td>
|
114
|
-
</xsl:when>
|
115
|
-
<xsl:when test="state='P'">
|
116
|
-
<td class="parked">
|
101
|
+
</td>
|
102
|
+
<td>
|
117
103
|
<xsl:choose>
|
118
|
-
<xsl:when test="
|
119
|
-
|
104
|
+
<xsl:when test="cpu_percentage >= 0">
|
105
|
+
<xsl:value-of select='format-number(cpu_percentage, "0.0")'/>
|
120
106
|
</xsl:when>
|
121
107
|
<xsl:otherwise>
|
122
|
-
<
|
123
|
-
<
|
124
|
-
|
125
|
-
</xsl:attribute>
|
126
|
-
<xsl:attribute name="title">
|
127
|
-
<xsl:value-of select="blocked_by/@name" />
|
128
|
-
</xsl:attribute>
|
129
|
-
Parked on <xsl:value-of select="blocked_by/@thread_id"/>
|
130
|
-
</a>
|
108
|
+
<div class="warning">[!]
|
109
|
+
<span class="warningtooltip">Error computing CPU percentage, javacores may be corrupted</span>
|
110
|
+
</div>
|
131
111
|
</xsl:otherwise>
|
132
112
|
</xsl:choose>
|
133
113
|
</td>
|
134
|
-
|
135
|
-
|
136
|
-
<
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
114
|
+
<td><xsl:value-of select='format-number(allocated_memory div 1024 div 1024, "0.00")'/></td>
|
115
|
+
<td><xsl:value-of select='java_stack_depth'/></td>
|
116
|
+
<xsl:choose>
|
117
|
+
<xsl:when test="state='CW'">
|
118
|
+
<td class="waiting">Waiting on condition</td>
|
119
|
+
</xsl:when>
|
120
|
+
<xsl:when test="state='R'">
|
121
|
+
<td class="runnable">Runnable</td>
|
122
|
+
</xsl:when>
|
123
|
+
<xsl:when test="state='P'">
|
124
|
+
<td class="parked">
|
125
|
+
<xsl:choose>
|
126
|
+
<xsl:when test="blocked_by=''">
|
127
|
+
Parked
|
128
|
+
</xsl:when>
|
129
|
+
<xsl:otherwise>
|
130
|
+
<a target="_blank">
|
131
|
+
<xsl:attribute name="href">
|
132
|
+
<xsl:value-of select="concat('../threads/thread_', blocked_by/@thread_hash, '.html')"/>
|
133
|
+
</xsl:attribute>
|
134
|
+
<xsl:attribute name="title">
|
135
|
+
<xsl:value-of select="blocked_by/@name" />
|
136
|
+
</xsl:attribute>
|
137
|
+
Parked on <xsl:value-of select="blocked_by/@thread_id"/>
|
138
|
+
</a>
|
139
|
+
</xsl:otherwise>
|
140
|
+
</xsl:choose>
|
141
|
+
</td>
|
142
|
+
</xsl:when>
|
143
|
+
<xsl:when test="state='B'">
|
144
|
+
<td class="blocked">
|
145
|
+
<a target="_blank">
|
146
|
+
<xsl:attribute name="href">
|
147
|
+
<xsl:value-of select="concat('../threads/thread_', blocked_by/@thread_hash, '.html')"/>
|
148
|
+
</xsl:attribute>
|
149
|
+
<xsl:attribute name="title">
|
150
|
+
<xsl:value-of select="blocked_by/@name" />
|
151
|
+
</xsl:attribute>
|
152
|
+
Blocked by <xsl:value-of select="blocked_by/@thread_id"/>
|
153
|
+
</a>
|
154
|
+
</td>
|
155
|
+
</xsl:when>
|
156
|
+
<xsl:otherwise>
|
157
|
+
<td><xsl:value-of select="state"/></td>
|
158
|
+
</xsl:otherwise>
|
159
|
+
</xsl:choose>
|
160
|
+
</tr>
|
161
|
+
</xsl:for-each>
|
162
|
+
</tbody>
|
163
|
+
</table>
|
164
|
+
</div>
|
156
165
|
</div>
|
157
166
|
</body>
|
158
167
|
<script type="text/javascript" src="../data/expand.js"> _ <!-- underscore character is required to prevent converting to <script /> which does not work --> </script>
|
@@ -748,7 +748,7 @@
|
|
748
748
|
|
749
749
|
<p></p>
|
750
750
|
<div class="margined">
|
751
|
-
<a href="https://
|
751
|
+
<a href="https://github.com/IBM/javacore-analyser/wiki" target="_blank">Documentation</a>
|
752
752
|
</div>
|
753
753
|
<div class="margined">
|
754
754
|
In case of any issues with the tool use Slack group:
|