javacore-analyser 2.0rc1__py3-none-any.whl → 2.0rc3__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- if(document.getElementById('sys_info_table').rows[2].cells[1].innerHTML.slice(-1).toLowerCase() === 'g')
151
- HEAP_SIZE = Number(document.getElementById('sys_info_table').rows[2].cells[1].innerHTML.slice(0, -1)) * MB_SIZE * 1024;
152
- else
153
- HEAP_SIZE = Number(document.getElementById('sys_info_table').rows[2].cells[1].innerHTML.slice(0, -1)) * MB_SIZE;
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
- <p class="right"><a href="../index.html"> Back to Main page </a></p>
29
- <h2>Wait Report for: <b>{id}</b></h2>
30
- <div id="all_threads">
31
- <table id="javacore_threads_table" class="tablesorter_blue">
32
- <thead>
33
- <tr>
34
- <th class="sixty">Thread name</th>
35
- <th>Total CPU usage (s)</th>
36
- <th>% CPU usage</th>
37
- <th>Memory allocated since last GC (MB)</th>
38
- <th>Java stack depth</th>
39
- <th>Status</th>
40
- </tr>
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
- <td class="left">
47
- <div>
48
- <xsl:attribute name="id">
49
- <xsl:value-of select="concat('stack',$i)"/>
50
- </xsl:attribute>
51
- <a target="_blank">
52
- <xsl:attribute name="href">
53
- <xsl:value-of select="concat('../threads/thread_', thread_hash, '.html')"/>
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
- <xsl:value-of select="thread_name"/>
56
- </a>
57
- <xsl:choose>
58
- <xsl:when test="stack_depth &gt; 0">
59
- <div>
60
- <div class="toggle_expand">
61
- <a href="javaScript:;" class="show">[+] Expand</a> <!-- "show" class is used in expand.js -->
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 &gt; 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
- <p class="stacktrace">
64
- <xsl:for-each select="*[starts-with(name(), 'line')]">
65
- <span>
66
- <xsl:attribute name="class">
67
- <xsl:value-of select="@kind"/>
68
- </xsl:attribute>
69
- <xsl:value-of select="current()"/>
70
- </span>
71
- <br/>
72
- </xsl:for-each>
73
- </p>
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 &gt;= 0">
93
+ <xsl:value-of select='format-number(cpu_usage, "0.00")'/>
75
94
  </xsl:when>
76
95
  <xsl:otherwise>
77
- No stack
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
- </div>
81
- </td>
82
- <td>
83
- <xsl:choose>
84
- <xsl:when test="cpu_usage &gt;= 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 &gt;= 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="blocked_by=''">
119
- Parked
104
+ <xsl:when test="cpu_percentage &gt;= 0">
105
+ <xsl:value-of select='format-number(cpu_percentage, "0.0")'/>
120
106
  </xsl:when>
121
107
  <xsl:otherwise>
122
- <a target="_blank">
123
- <xsl:attribute name="href">
124
- <xsl:value-of select="concat('../threads/thread_', blocked_by/@thread_hash, '.html')"/>
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
- </xsl:when>
135
- <xsl:when test="state='B'">
136
- <td class="blocked">
137
- <a target="_blank">
138
- <xsl:attribute name="href">
139
- <xsl:value-of select="concat('../threads/thread_', blocked_by/@thread_hash, '.html')"/>
140
- </xsl:attribute>
141
- <xsl:attribute name="title">
142
- <xsl:value-of select="blocked_by/@name" />
143
- </xsl:attribute>
144
- Blocked by <xsl:value-of select="blocked_by/@thread_id"/>
145
- </a>
146
- </td>
147
- </xsl:when>
148
- <xsl:otherwise>
149
- <td><xsl:value-of select="state"/></td>
150
- </xsl:otherwise>
151
- </xsl:choose>
152
- </tr>
153
- </xsl:for-each>
154
- </tbody>
155
- </table>
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://w3.ibm.com/w3publisher/wait2-tool" target="_blank">Documentation</a>
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:
@@ -20,177 +20,186 @@
20
20
  <script type="text/javascript" src="../data/jquery/chart.js"> _ </script>
21
21
  <script type="text/javascript" src="../data/jquery/chartjs-adapter-date-fns.bundle.min.js"> _ </script>
22
22
  <script type="text/javascript" src="../data/jquery/wait2scripts.js"> _ </script>
23
-
23
+ <script src="../data/jquery/jquery.mark.min.js"> _ </script>
24
+ <script type="text/javascript" src="../data/jquery/search.js"> _ </script>
24
25
  </head>
25
-
26
26
  <body id="doc_body" height="100%">
27
- <p class="right"><a href="../index.html"> Back to Main page </a></p>
28
- <h2>Wait Report for thread: <b><xsl:value-of select="thread_name"/></b></h2>
29
- <xsl:choose>
30
- <xsl:when test="//javacore_count = 1">
31
- System resource utilization data cannot be calculated with only a single javacore.
32
- </xsl:when>
33
- <xsl:otherwise>
34
- <div class="chart-container" height="25%">
35
- <canvas id="myChart" height="100%"></canvas>
36
- </div>
37
- </xsl:otherwise>
38
- </xsl:choose>
39
- <div id="all_threads">
40
- <table id="all_threads_table_thread_xsl">
41
- <thead>
42
- <tr>
43
- <th>Timestamp</th>
44
- <th>Elapsed time (s)</th>
45
- <th>CPU usage (s)</th>
46
- <th>% CPU usage</th>
47
- <th class='sixty'>Stack trace</th>
48
- <th>State</th>
49
- <th>Blocking</th>
50
- </tr>
51
- </thead>
52
- <!-- Snapshot starts here -->
53
- <xsl:for-each select="*[starts-with(name(), 'stack')]">
54
- <tr>
55
- <td>
56
- <a>
57
- <xsl:attribute name="href">
58
- ../javacores/<xsl:value-of select="file_name"/>.html
59
- </xsl:attribute>
60
- <xsl:value-of select='timestamp'/>
61
- </a>
62
- </td>
63
- <xsl:choose>
64
- <xsl:when test="position()=1">
65
- <td>N/A</td>
66
- </xsl:when>
67
- <xsl:otherwise>
68
- <td>
69
- <xsl:value-of select='format-number(elapsed_time, "0.##")'/>
70
- </td>
71
- </xsl:otherwise>
72
- </xsl:choose>
73
- <xsl:choose>
74
- <xsl:when test="position()=1">
75
- <td>N/A</td>
76
- </xsl:when>
77
- <xsl:otherwise>
78
- <td><xsl:value-of select='format-number(cpu_usage, "0.##")'/></td>
79
- </xsl:otherwise>
80
- </xsl:choose>
81
- <xsl:choose>
27
+ <div class="searchbar">
28
+ <input id="search-input" type="search" />
29
+ <button data-search="search" id="search-button">Search</button>
30
+ <button data-search="next">Next</button>
31
+ <button data-search="prev">Prev</button>
32
+ <button data-search="clear">✖</button>
33
+ </div>
34
+ <div class="content">
35
+ <p class="right"><a href="../index.html"> Back to Main page </a></p>
36
+ <h2>Wait Report for thread: <b><xsl:value-of select="thread_name"/></b></h2>
37
+ <xsl:choose>
38
+ <xsl:when test="//javacore_count = 1">
39
+ System resource utilization data cannot be calculated with only a single javacore.
40
+ </xsl:when>
41
+ <xsl:otherwise>
42
+ <div class="chart-container" height="25%">
43
+ <canvas id="myChart" height="100%"></canvas>
44
+ </div>
45
+ </xsl:otherwise>
46
+ </xsl:choose>
47
+ <div id="all_threads">
48
+ <table id="all_threads_table_thread_xsl">
49
+ <thead>
50
+ <tr>
51
+ <th>Timestamp</th>
52
+ <th>Elapsed time (s)</th>
53
+ <th>CPU usage (s)</th>
54
+ <th>% CPU usage</th>
55
+ <th class='sixty'>Stack trace</th>
56
+ <th>State</th>
57
+ <th>Blocking</th>
58
+ </tr>
59
+ </thead>
60
+ <!-- Snapshot starts here -->
61
+ <xsl:for-each select="*[starts-with(name(), 'stack')]">
62
+ <tr>
63
+ <td>
64
+ <a>
65
+ <xsl:attribute name="href">
66
+ ../javacores/<xsl:value-of select="file_name"/>.html
67
+ </xsl:attribute>
68
+ <xsl:value-of select='timestamp'/>
69
+ </a>
70
+ </td>
71
+ <xsl:choose>
82
72
  <xsl:when test="position()=1">
83
73
  <td>N/A</td>
84
74
  </xsl:when>
85
75
  <xsl:otherwise>
86
- <td><xsl:value-of select='format-number(cpu_percentage, "0.#")'/></td>
76
+ <td>
77
+ <xsl:value-of select='format-number(elapsed_time, "0.##")'/>
78
+ </td>
87
79
  </xsl:otherwise>
88
80
  </xsl:choose>
89
- <td class="left">
90
- <div>
91
- <xsl:choose>
92
- <xsl:when test="stack_depth &gt; 0">
93
- <div class="toggle_expand">
94
- <a href="javaScript:;" class="show">[+] Expand</a>
95
- </div>
96
- <p class="stacktrace">
97
- <xsl:for-each select="*[starts-with(name(), 'line')]">
98
- <span>
99
- <xsl:attribute name="class"><xsl:value-of select="@kind"/></xsl:attribute>
100
- <xsl:value-of select="current()"/>
101
- </span>
102
- <br/>
103
- </xsl:for-each>
104
- </p>
81
+ <xsl:choose>
82
+ <xsl:when test="position()=1">
83
+ <td>N/A</td>
84
+ </xsl:when>
85
+ <xsl:otherwise>
86
+ <td><xsl:value-of select='format-number(cpu_usage, "0.##")'/></td>
87
+ </xsl:otherwise>
88
+ </xsl:choose>
89
+ <xsl:choose>
90
+ <xsl:when test="position()=1">
91
+ <td>N/A</td>
105
92
  </xsl:when>
106
93
  <xsl:otherwise>
107
- No Stack
94
+ <td><xsl:value-of select='format-number(cpu_percentage, "0.#")'/></td>
108
95
  </xsl:otherwise>
109
96
  </xsl:choose>
110
- </div>
111
- </td>
112
- <xsl:choose>
113
- <xsl:when test="state='CW'">
114
- <td class="waiting">
115
- <xsl:choose>
116
- <xsl:when test="blocked_by=''">
117
- Waiting on condition
118
- </xsl:when>
119
- <xsl:otherwise>
120
- <a target="_blank">
121
- <xsl:attribute name="href">
122
- <xsl:value-of select="concat('thread_', blocked_by/@thread_hash, '.html')"/>
123
- </xsl:attribute>
124
- <xsl:attribute name="title">
125
- <xsl:value-of select="blocked_by/@name" />
126
- </xsl:attribute>
127
- Waiting for <xsl:value-of select="blocked_by/@thread_id"/>
128
- </a>
129
- </xsl:otherwise>
130
- </xsl:choose>
131
- </td>
132
- </xsl:when>
133
- <xsl:when test="state='R'">
134
- <td class="runnable">Runnable</td>
135
- </xsl:when>
136
- <xsl:when test="state='P'">
137
- <td class="parked">
97
+ <td class="left">
98
+ <div>
138
99
  <xsl:choose>
139
- <xsl:when test="blocked_by=''">
140
- Parked
100
+ <xsl:when test="stack_depth &gt; 0">
101
+ <div class="toggle_expand">
102
+ <a href="javaScript:;" class="show">[+] Expand</a>
103
+ </div>
104
+ <p class="stacktrace">
105
+ <xsl:for-each select="*[starts-with(name(), 'line')]">
106
+ <span>
107
+ <xsl:attribute name="class"><xsl:value-of select="@kind"/></xsl:attribute>
108
+ <xsl:value-of select="current()"/>
109
+ </span>
110
+ <br/>
111
+ </xsl:for-each>
112
+ </p>
141
113
  </xsl:when>
142
114
  <xsl:otherwise>
143
- <a target="_blank">
144
- <xsl:attribute name="href">
145
- <xsl:value-of select="concat('thread_', blocked_by/@thread_hash, '.html')"/>
146
- </xsl:attribute>
147
- <xsl:attribute name="title">
148
- <xsl:value-of select="blocked_by/@name" />
149
- </xsl:attribute>
150
- Parked on <xsl:value-of select="blocked_by/@thread_id"/>
151
- </a>
115
+ No Stack
152
116
  </xsl:otherwise>
153
117
  </xsl:choose>
154
- </td>
155
- </xsl:when>
156
- <xsl:when test="state='B'">
157
- <td class="blocked">
158
- <a target="_blank">
159
- <xsl:attribute name="href">
160
- <xsl:value-of select="concat('thread_', blocked_by/@thread_hash, '.html')"/>
161
- </xsl:attribute>
162
- <xsl:attribute name="title">
163
- <xsl:value-of select="blocked_by/@name" />
164
- </xsl:attribute>
165
- Blocked by <xsl:value-of select="blocked_by/@thread_id"/>
166
- </a>
167
- </td>
168
- </xsl:when>
169
- <xsl:otherwise>
170
- <td><xsl:value-of select="state"/></td>
171
- </xsl:otherwise>
172
- </xsl:choose>
173
- <td>
118
+ </div>
119
+ </td>
174
120
  <xsl:choose>
175
- <xsl:when test="blocking/thread">
176
- blocking:
177
- <xsl:for-each select="blocking/thread">
178
- <a target="_blank">
179
- <xsl:attribute name="href">
180
- <xsl:value-of select="concat('thread_', @thread_hash, '.html')"/>
181
- </xsl:attribute>
182
- <xsl:attribute name="title">
183
- <xsl:value-of select="@name" />
184
- </xsl:attribute>
185
- <xsl:value-of select="@thread_id" />
186
- </a>;
187
- </xsl:for-each>
188
- </xsl:when>
189
- </xsl:choose>
190
- </td>
191
- </tr>
192
- </xsl:for-each>
193
- </table>
121
+ <xsl:when test="state='CW'">
122
+ <td class="waiting">
123
+ <xsl:choose>
124
+ <xsl:when test="blocked_by=''">
125
+ Waiting on condition
126
+ </xsl:when>
127
+ <xsl:otherwise>
128
+ <a target="_blank">
129
+ <xsl:attribute name="href">
130
+ <xsl:value-of select="concat('thread_', blocked_by/@thread_hash, '.html')"/>
131
+ </xsl:attribute>
132
+ <xsl:attribute name="title">
133
+ <xsl:value-of select="blocked_by/@name" />
134
+ </xsl:attribute>
135
+ Waiting for <xsl:value-of select="blocked_by/@thread_id"/>
136
+ </a>
137
+ </xsl:otherwise>
138
+ </xsl:choose>
139
+ </td>
140
+ </xsl:when>
141
+ <xsl:when test="state='R'">
142
+ <td class="runnable">Runnable</td>
143
+ </xsl:when>
144
+ <xsl:when test="state='P'">
145
+ <td class="parked">
146
+ <xsl:choose>
147
+ <xsl:when test="blocked_by=''">
148
+ Parked
149
+ </xsl:when>
150
+ <xsl:otherwise>
151
+ <a target="_blank">
152
+ <xsl:attribute name="href">
153
+ <xsl:value-of select="concat('thread_', blocked_by/@thread_hash, '.html')"/>
154
+ </xsl:attribute>
155
+ <xsl:attribute name="title">
156
+ <xsl:value-of select="blocked_by/@name" />
157
+ </xsl:attribute>
158
+ Parked on <xsl:value-of select="blocked_by/@thread_id"/>
159
+ </a>
160
+ </xsl:otherwise>
161
+ </xsl:choose>
162
+ </td>
163
+ </xsl:when>
164
+ <xsl:when test="state='B'">
165
+ <td class="blocked">
166
+ <a target="_blank">
167
+ <xsl:attribute name="href">
168
+ <xsl:value-of select="concat('thread_', blocked_by/@thread_hash, '.html')"/>
169
+ </xsl:attribute>
170
+ <xsl:attribute name="title">
171
+ <xsl:value-of select="blocked_by/@name" />
172
+ </xsl:attribute>
173
+ Blocked by <xsl:value-of select="blocked_by/@thread_id"/>
174
+ </a>
175
+ </td>
176
+ </xsl:when>
177
+ <xsl:otherwise>
178
+ <td><xsl:value-of select="state"/></td>
179
+ </xsl:otherwise>
180
+ </xsl:choose>
181
+ <td>
182
+ <xsl:choose>
183
+ <xsl:when test="blocking/thread">
184
+ blocking:
185
+ <xsl:for-each select="blocking/thread">
186
+ <a target="_blank">
187
+ <xsl:attribute name="href">
188
+ <xsl:value-of select="concat('thread_', @thread_hash, '.html')"/>
189
+ </xsl:attribute>
190
+ <xsl:attribute name="title">
191
+ <xsl:value-of select="@name" />
192
+ </xsl:attribute>
193
+ <xsl:value-of select="@thread_id" />
194
+ </a>;
195
+ </xsl:for-each>
196
+ </xsl:when>
197
+ </xsl:choose>
198
+ </td>
199
+ </tr>
200
+ </xsl:for-each>
201
+ </table>
202
+ </div>
194
203
  </div>
195
204
  </body>
196
205
  <script>loadChart();</script>
@@ -15,8 +15,10 @@ from pathlib import Path
15
15
  from xml.dom.minidom import parseString
16
16
 
17
17
  import importlib_resources
18
+ from importlib_resources.abc import Traversable
18
19
  from lxml import etree
19
20
  from lxml.etree import XMLSyntaxError
21
+ from tqdm import tqdm
20
22
 
21
23
  from javacore_analyser import tips
22
24
  from javacore_analyser.code_snapshot_collection import CodeSnapshotCollection
@@ -140,28 +142,28 @@ class JavacoreSet:
140
142
  shutil.rmtree(data_output_dir, ignore_errors=True)
141
143
  logging.info("Data dir: " + data_output_dir)
142
144
 
143
- style_css_resource = importlib_resources.files("javacore_analyser") / "data" / "style.css"
145
+ style_css_resource: Traversable = importlib_resources.files("javacore_analyser") / "data" / "style.css"
144
146
  data_dir = os.path.dirname(style_css_resource)
145
147
  os.mkdir(data_output_dir)
146
148
  shutil.copytree(data_dir, data_output_dir, dirs_exist_ok=True)
147
149
 
148
150
  def __generate_htmls_for_threads(self, output_dir, temp_dir_name):
149
- _create_xml_xsl_for_collection(temp_dir_name + "/threads",
150
- output_dir + "/data/xml/threads", "thread",
151
+ _create_xml_xsl_for_collection(os.path.join(temp_dir_name, "threads"),
152
+ os.path.join(output_dir, "data", "xml", "threads"), "thread",
151
153
  self.threads,
152
154
  "thread")
153
155
  self.generate_htmls_from_xmls_xsls(self.report_xml_file,
154
- temp_dir_name + "/threads",
155
- output_dir + "/threads", )
156
+ os.path.join(temp_dir_name, "threads"),
157
+ os.path.join(output_dir, "threads"))
156
158
 
157
159
  def __generate_htmls_for_javacores(self, output_dir, temp_dir_name):
158
- _create_xml_xsl_for_collection(temp_dir_name + "/javacores",
159
- output_dir + "/data/xml/javacores/", "javacore",
160
+ _create_xml_xsl_for_collection(os.path.join(temp_dir_name, "javacores"),
161
+ os.path.join(output_dir, "data", "xml", "javacores"), "javacore",
160
162
  self.javacores,
161
163
  "")
162
164
  self.generate_htmls_from_xmls_xsls(self.report_xml_file,
163
- temp_dir_name + "/javacores",
164
- output_dir + "/javacores", )
165
+ os.path.join(temp_dir_name, "javacores"),
166
+ os.path.join(output_dir, "javacores"))
165
167
 
166
168
  def populate_snapshot_collections(self):
167
169
  for javacore in self.javacores:
@@ -519,10 +521,13 @@ class JavacoreSet:
519
521
  os.mkdir(output_dir)
520
522
  shutil.copy2(report_xml_file, data_input_dir)
521
523
 
524
+ list_files = os.listdir(data_input_dir)
525
+ progress_bar = tqdm(desc="Generating html files", unit=' files')
526
+
522
527
  # Generating list of tuples. This is required attribute for p.map function executed few lines below.
523
528
  generate_html_from_xml_xsl_files_params = []
524
- for file in os.listdir(data_input_dir):
525
- generate_html_from_xml_xsl_files_params.append((file, data_input_dir, output_dir))
529
+ for file in list_files:
530
+ generate_html_from_xml_xsl_files_params.append((file, data_input_dir, output_dir, progress_bar))
526
531
 
527
532
  # https://docs.python.org/3.8/library/multiprocessing.html
528
533
  threads_no = JavacoreSet.get_number_of_parallel_threads()
@@ -530,6 +535,7 @@ class JavacoreSet:
530
535
  with Pool(threads_no) as p:
531
536
  p.map(JavacoreSet.generate_html_from_xml_xsl_files, generate_html_from_xml_xsl_files_params)
532
537
 
538
+ progress_bar.close()
533
539
  logging.info(f"Generated html files in {output_dir}")
534
540
 
535
541
  # Run with the same number of threads as you have processes but leave one thread for something else.
@@ -540,7 +546,7 @@ class JavacoreSet:
540
546
  @staticmethod
541
547
  def generate_html_from_xml_xsl_files(args):
542
548
 
543
- collection_file, collection_input_dir, output_dir = args
549
+ collection_file, collection_input_dir, output_dir, progress_bar = args
544
550
 
545
551
  if not collection_file.endswith(".xsl"): return
546
552
 
@@ -567,6 +573,25 @@ class JavacoreSet:
567
573
  logging.debug("Generating file " + html_file)
568
574
  output_doc.write(html_file, pretty_print=True)
569
575
 
576
+ progress_bar.update(1)
577
+
578
+ def create_xml_xsl_for_collection(self, tmp_dir, xml_xsls_prefix_path, collection, output_file_prefix):
579
+ logging.info("Creating xmls and xsls in " + tmp_dir)
580
+ os.mkdir(tmp_dir)
581
+ extensions = [".xsl", ".xml"]
582
+ for extension in extensions:
583
+ file_content = Path(xml_xsls_prefix_path + extension).read_text()
584
+ for element in tqdm(collection, desc="Creating xml/xsl files", unit=" files"):
585
+ element_id = element.get_id()
586
+ filename = output_file_prefix + "_" + str(element_id) + extension
587
+ if filename.startswith("_"):
588
+ filename = filename[1:]
589
+ file = os.path.join(tmp_dir, filename)
590
+ logging.debug("Writing file " + file)
591
+ f = open(file, "w")
592
+ f.write(file_content.format(id=element_id))
593
+ f.close()
594
+
570
595
  @staticmethod
571
596
  def parse_mem_arg(line):
572
597
  line = line.split()[-1] # avoid matching the '2' in tag name 2CIUSERARG
@@ -17,12 +17,17 @@
17
17
 
18
18
  <h2>Generate report:</h2>
19
19
  <form action="/upload" method="post" enctype="multipart/form-data">
20
- <br>Report Name: <input type="text" id="report_name" name="report_name" required></br>
21
- <br>Archive file or multiple javacore files: <input type="file" name="files" multiple required> </br>
20
+ <ol>
21
+ <li>Choose archive (zip, 7z, tgz, bz2) file or multiple javacore files:
22
+ <input type="file" name="files" multiple required>
23
+ </li>
24
+ <li>Give the name for your report: <input type="text" id="report_name" name="report_name" required></li>
25
+ <li>Click button to process: <input type="submit" value="Run"></li>
26
+ </ol>
22
27
  <strong>
23
- NOTE: The report generation is expensive operation and might take even few minutes. Please be patient
28
+ NOTE: Report generation is an expensive operation. It may take a few minutes. Please be patient.
24
29
  </strong>
25
- <br><input type="submit" value="Upload"></br>
30
+
26
31
  </form>
27
32
  <br></br>
28
33
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: javacore_analyser
3
- Version: 2.0rc1
3
+ Version: 2.0rc3
4
4
  Summary: The tool to review IBM Javacore files
5
5
  Project-URL: Homepage, https://github.com/IBM/javacore-analyser
6
6
  Project-URL: Issues, https://github.com/IBM/javacore-analyser/issues
@@ -226,12 +226,12 @@ Classifier: Programming Language :: Python :: 3.11
226
226
  Classifier: Programming Language :: Python :: 3.12
227
227
  Classifier: Programming Language :: Python :: 3.13
228
228
  Requires-Python: >=3.9
229
- Requires-Dist: dicttoxml
230
229
  Requires-Dist: flask
231
230
  Requires-Dist: importlib-resources
232
231
  Requires-Dist: lxml
233
232
  Requires-Dist: py7zr
234
233
  Requires-Dist: pyana
234
+ Requires-Dist: tqdm
235
235
  Requires-Dist: waitress
236
236
  Description-Content-Type: text/markdown
237
237
 
@@ -6,7 +6,7 @@ javacore_analyser/java_thread.py,sha256=4zUfmmlH47SrIxgfPmrJHl_YUziVJXVNVedD5X25
6
6
  javacore_analyser/javacore.py,sha256=NkvxN6C93eG24wEB_kfH-yf0_f_ECj7Let4bQ1i22AM,6860
7
7
  javacore_analyser/javacore_analyser_batch.py,sha256=ApC_xcDMIP4DxQ0MUiD6XrF3hzcyFmofVH1Jq4-6_4s,5408
8
8
  javacore_analyser/javacore_analyser_web.py,sha256=DJgzHKuGUkATKaE7pI6zOQPGITB6hdM86tUXsZ1fCWw,4526
9
- javacore_analyser/javacore_set.py,sha256=3EIl3Wrq3RUo3APfHmDq4Nllq5_ufSC9qZquogiy4ns,29420
9
+ javacore_analyser/javacore_set.py,sha256=3_KfoT4wKYmUROUQXJInaPxKi60zauqAK11Iat3Y55Q,30689
10
10
  javacore_analyser/logging_utils.py,sha256=vLob0ikezysjGv9XGqv9GbLekxu4eO_csq22M-gtLiQ,966
11
11
  javacore_analyser/snapshot_collection.py,sha256=fLEnwg9-cOjVVUUludtzI7R2yO9BBVgJgxkhvqG5QDg,443
12
12
  javacore_analyser/snapshot_collection_collection.py,sha256=JyNr038nC8mcX1mjeXjNSzZT4oE9ACFmCYJORUKzyvw,1265
@@ -29,16 +29,16 @@ javacore_analyser/data/jquery/search.js,sha256=hY0kp5ZIUazzM32hEmArA3ql6MTiOjjf5
29
29
  javacore_analyser/data/jquery/sorting.js,sha256=HsuVLa7F70IM4ZMXZpjj7wtVI1TXL1SPbZGWenv0Jp8,369
30
30
  javacore_analyser/data/jquery/theme.blue.css,sha256=mI0RCGd6G5GOKSG7BPagp0N58xipSjPXUKvrcHJ4h1Q,7528
31
31
  javacore_analyser/data/jquery/theme.default.min.css,sha256=5sgExNTnkN8NcApKIU73_aqgZmqq_zJp9-9zXf9aSEw,4502
32
- javacore_analyser/data/jquery/wait2scripts.js,sha256=DmSgbHk_nP-9Echk1OwvdVXi_MwsfdFe0F7qIyfmsbM,8054
32
+ javacore_analyser/data/jquery/wait2scripts.js,sha256=CMbSqte7Ln0hP9ZScESGdIDfWEmxJwvfLZjDfYNc1Sg,8427
33
33
  javacore_analyser/data/xml/index.xml,sha256=9VH2rmri3FQpXcW39kbyi2dON94C5XTiaQn0ioExCe8,282
34
- javacore_analyser/data/xml/report.xsl,sha256=ZFcy8dfEB7rTQwcQvUKKSvyEl7HylXgjHjD7bWVpYes,49693
34
+ javacore_analyser/data/xml/report.xsl,sha256=XEwgf0qfXL1fXjj-X5iYYwt-D0cPjI9mLjhTmRvyNnk,49697
35
35
  javacore_analyser/data/xml/javacores/javacore.xml,sha256=6dG89Whx1_kpEYVS_F6Upa2XuXnXorlQATFc8kD5Mfc,280
36
- javacore_analyser/data/xml/javacores/javacore.xsl,sha256=9FANZSXy1pTKIkb2pMQBS9IxOfAK2yKRzsKlabs-X2g,10509
36
+ javacore_analyser/data/xml/javacores/javacore.xsl,sha256=5cnIp08Q9FccljHH8duoJQYofyW8lwUCGtpdzz5Y0Y8,11644
37
37
  javacore_analyser/data/xml/threads/thread.xml,sha256=6dG89Whx1_kpEYVS_F6Upa2XuXnXorlQATFc8kD5Mfc,280
38
- javacore_analyser/data/xml/threads/thread.xsl,sha256=YvfwICfSDNQbB7tSrISCdlQ1hTNkfiEFd0XtO7-Lhb0,12636
39
- javacore_analyser/templates/index.html,sha256=3XVMLjUOv8e5ISW_Z4OyvVuBxnb2Ytrq-seC810kUq8,1582
40
- javacore_analyser-2.0rc1.dist-info/METADATA,sha256=ZA-ftJphoR5Tb37o6_rpGjuVquHAhg2c2rxuVgVGU0c,20363
41
- javacore_analyser-2.0rc1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
42
- javacore_analyser-2.0rc1.dist-info/entry_points.txt,sha256=W3S799zI58g5-jWMsC3wY9xksz21LPEMYOILv8sayfM,160
43
- javacore_analyser-2.0rc1.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
44
- javacore_analyser-2.0rc1.dist-info/RECORD,,
38
+ javacore_analyser/data/xml/threads/thread.xsl,sha256=rkqr5GQ2aZ_xrdhUjl2QZDCZ-09zxqUmtV8DFZVjTAA,13927
39
+ javacore_analyser/templates/index.html,sha256=aEuyry-HZ9HlQNwfbugugvqbSxwlo7LrQnrDmqO34YE,1682
40
+ javacore_analyser-2.0rc3.dist-info/METADATA,sha256=BuAHmwoorqey194rBsfXSbM8kTaBWfZE0OyjgADWlS0,20358
41
+ javacore_analyser-2.0rc3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
42
+ javacore_analyser-2.0rc3.dist-info/entry_points.txt,sha256=W3S799zI58g5-jWMsC3wY9xksz21LPEMYOILv8sayfM,160
43
+ javacore_analyser-2.0rc3.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
44
+ javacore_analyser-2.0rc3.dist-info/RECORD,,