javacore-analyser 2.0rc1__tar.gz → 2.0rc3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/PKG-INFO +2 -2
  2. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/pyproject.toml +4 -4
  3. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/requirements.txt +2 -2
  4. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/wait2scripts.js +27 -5
  5. javacore_analyser-2.0rc3/src/javacore_analyser/data/xml/javacores/javacore.xsl +174 -0
  6. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/xml/report.xsl +1 -1
  7. javacore_analyser-2.0rc3/src/javacore_analyser/data/xml/threads/thread.xsl +213 -0
  8. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/javacore_set.py +37 -12
  9. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/templates/index.html +9 -4
  10. javacore_analyser-2.0rc1/src/javacore_analyser/data/xml/javacores/javacore.xsl +0 -165
  11. javacore_analyser-2.0rc1/src/javacore_analyser/data/xml/threads/thread.xsl +0 -204
  12. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  13. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/.github/dco.yml +0 -0
  15. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/.gitignore +0 -0
  16. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/.travis.yml +0 -0
  17. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/CHANGELOG.md +0 -0
  18. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/CODE_OF_CONDUCT.md +0 -0
  19. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/CONTRIBUTING.md +0 -0
  20. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/LICENSE +0 -0
  21. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/MAINTAINERS.md +0 -0
  22. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/README.md +0 -0
  23. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/REQUIREMENTS.md +0 -0
  24. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/SECURITY.md +0 -0
  25. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/docs/ClassDiagram.png +0 -0
  26. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/docs/dom_example.py +0 -0
  27. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/__init__.py +0 -0
  28. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/abstract_snapshot_collection.py +0 -0
  29. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/code_snapshot_collection.py +0 -0
  30. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/constants.py +0 -0
  31. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/expand.js +0 -0
  32. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/chart.js +0 -0
  33. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/chartjs-adapter-date-fns.bundle.min.js +0 -0
  34. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/jq.css +0 -0
  35. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/jquery.mark.min.js +0 -0
  36. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/jquery.min.js +0 -0
  37. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/jquery.tablesorter.min.js +0 -0
  38. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/jquery.tablesorter.widgets.min.js +0 -0
  39. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/search.js +0 -0
  40. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/sorting.js +0 -0
  41. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/theme.blue.css +0 -0
  42. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/jquery/theme.default.min.css +0 -0
  43. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/style.css +0 -0
  44. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/xml/index.xml +0 -0
  45. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/xml/javacores/javacore.xml +0 -0
  46. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/data/xml/threads/thread.xml +0 -0
  47. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/java_thread.py +0 -0
  48. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/javacore.py +0 -0
  49. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/javacore_analyser_batch.py +0 -0
  50. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/javacore_analyser_web.py +0 -0
  51. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/logging_utils.py +0 -0
  52. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/snapshot_collection.py +0 -0
  53. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/snapshot_collection_collection.py +0 -0
  54. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/stack_trace.py +0 -0
  55. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/stack_trace_element.py +0 -0
  56. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/stack_trace_kind.py +0 -0
  57. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/thread_snapshot.py +0 -0
  58. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/tips.py +0 -0
  59. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/src/javacore_analyser/verbose_gc.py +0 -0
  60. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/__init__.py +0 -0
  61. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/archive_without_javacores.zip +0 -0
  62. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores/aaa-javacore.20220606.114458.32888.0001.txt +0 -0
  63. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores/aaa-javacore.20220606.114502.32888.0002.txt +0 -0
  64. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores-corrupted.zip +0 -0
  65. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores-starting-aaa.zip +0 -0
  66. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores.7z +0 -0
  67. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores.tar.bz2 +0 -0
  68. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores.tar.gz +0 -0
  69. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores.tgz +0 -0
  70. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores.zip +0 -0
  71. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/archives/javacores_with_invalid_chars.zip +0 -0
  72. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/issue129/javacore.20230602.091848.83156.0001.txt +0 -0
  73. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/issue129/javacore.20230602.091853.83156.0002.txt +0 -0
  74. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114458.32888.0001.txt +0 -0
  75. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114502.32888.0002.txt +0 -0
  76. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114506.32888.0003.txt +0 -0
  77. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114513.32888.0004.txt +0 -0
  78. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114516.32888.0005.txt +0 -0
  79. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114900.32888.0006.txt +0 -0
  80. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114907.32888.0007.txt +0 -0
  81. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114912.32888.0008.txt +0 -0
  82. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114931.32888.0009.txt +0 -0
  83. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114947.32888.0010.txt +0 -0
  84. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114948.32888.0011.txt +0 -0
  85. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.20220606.114949.32888.0012.txt +0 -0
  86. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/javacore.wrong.corr +0 -0
  87. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/verbosegc.230105.19308.txt.001 +0 -0
  88. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/verbosegc.230413.19984.txt.001 +0 -0
  89. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/javacores/verbosegc.230420.33424.txt.001 +0 -0
  90. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/quotationMarks/javacore.20230830.134339.30220.0001.txt +0 -0
  91. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/quotationMarks/javacore.20230830.134339.30220.0002.txt +0 -0
  92. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGc/verbosegc.230105.19308.txt.001 +0 -0
  93. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGc/verbosegc.230413.19984.txt.001 +0 -0
  94. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGc/verbosegc.230420.33424.txt.001 +0 -0
  95. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/javacore.20230602.091848.83156.0001.txt +0 -0
  96. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/javacore.20230602.091853.83156.0002.txt +0 -0
  97. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/javacore.20230602.092423.83156.0003.txt +0 -0
  98. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/javacore.20230602.092537.83156.0004.txt +0 -0
  99. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/javacore.20230602.092604.83156.0005.txt +0 -0
  100. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/verbosegc.230602.61164.txt.001 +0 -0
  101. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores/verbosegc.230602.83156.txt.001 +0 -0
  102. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/data/verboseGcJavacores.zip +0 -0
  103. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_code_snapshot_collection.py +0 -0
  104. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_gc_collection.py +0 -0
  105. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_java_thread.py +0 -0
  106. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_javacore.py +0 -0
  107. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_javacore_analyser.py +0 -0
  108. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_javacore_set.py +0 -0
  109. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_stack_trace.py +0 -0
  110. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_stack_trace_element.py +0 -0
  111. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_thread_snapshot.py +0 -0
  112. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_tips.py +0 -0
  113. {javacore_analyser-2.0rc1 → javacore_analyser-2.0rc3}/test/test_verbose_gc_parser.py +0 -0
@@ -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
 
@@ -8,9 +8,9 @@ requires = ["hatchling", "versioningit"]
8
8
  build-backend = "hatchling.build"
9
9
 
10
10
  [project]
11
- #dynamic = ["version"]
11
+ dynamic = ["version"]
12
12
  name = "javacore_analyser"
13
- version = "2.0rc1"
13
+ #version = "2.0rc1"
14
14
  authors = [
15
15
  { name="Krzysztof Kazmierczyk", email="kazm@ibm.com" },
16
16
  { name="Piotr Aniola", email="Piotr.Aniola@ibm.com" },
@@ -40,13 +40,13 @@ classifiers = [
40
40
  "Natural Language :: English",
41
41
  ]
42
42
  dependencies = [
43
- "dicttoxml",
44
43
  "py7zr",
45
44
  "lxml",
46
45
  "pyana",
47
46
  "importlib-resources",
48
47
  "flask",
49
- "waitress"
48
+ "waitress",
49
+ "tqdm"
50
50
  ]
51
51
 
52
52
  [project.scripts]
@@ -1,7 +1,7 @@
1
- dicttoxml
2
1
  py7zr
3
2
  lxml
4
3
  pyana
5
4
  importlib-resources
6
5
  waitress # Production WSGI server
7
- flask # WSGI server for development the code
6
+ flask # WSGI server for development the code
7
+ tqdm
@@ -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
@@ -0,0 +1,174 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <!--
4
+ # Copyright IBM Corp. 2024 - 2024
5
+ # SPDX-License-Identifier: Apache-2.0
6
+ -->
7
+
8
+ <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
9
+ <xsl:template match="text()"/> <!-- these are not the nodes you're looking for -->
10
+ <xsl:template match="/">
11
+ <html height="100%">
12
+ <head>
13
+ <link rel="stylesheet" href="../data/style.css"/>
14
+ <link rel="stylesheet" href="../data/jquery/jq.css" />
15
+ <link rel="stylesheet" href="../data/jquery/theme.blue.css" />
16
+ <link rel="stylesheet" href="../data/jquery/theme.default.min.css" />
17
+ <script type="text/javascript" src="../data/jquery/jquery.min.js"> _ </script>
18
+ <script type="text/javascript" src="../data/jquery/jquery.tablesorter.min.js"> _ </script>
19
+ <script type="text/javascript" src="../data/jquery/jquery.tablesorter.widgets.min.js"> _ </script>
20
+ <script type="text/javascript" src="../data/jquery/wait2scripts.js"> _ </script>
21
+ <script type="text/javascript" src="../data/jquery/sorting.js"> _ </script>
22
+ <script type="text/javascript" src="../data/expand.js"> _ </script>
23
+ <script src="../data/jquery/jquery.mark.min.js"> _ </script>
24
+ <script type="text/javascript" src="../data/jquery/search.js"> _ </script>
25
+ </head>
26
+
27
+ <body id="doc_body" height="100%">
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>
41
+ <tr>
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)"/>
58
+ </xsl:attribute>
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>
82
+ </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")'/>
94
+ </xsl:when>
95
+ <xsl:otherwise>
96
+ <div class="warning">[!]
97
+ <span class="warningtooltip">Error computing CPU usage, javacores may be corrupted</span>
98
+ </div>
99
+ </xsl:otherwise>
100
+ </xsl:choose>
101
+ </td>
102
+ <td>
103
+ <xsl:choose>
104
+ <xsl:when test="cpu_percentage &gt;= 0">
105
+ <xsl:value-of select='format-number(cpu_percentage, "0.0")'/>
106
+ </xsl:when>
107
+ <xsl:otherwise>
108
+ <div class="warning">[!]
109
+ <span class="warningtooltip">Error computing CPU percentage, javacores may be corrupted</span>
110
+ </div>
111
+ </xsl:otherwise>
112
+ </xsl:choose>
113
+ </td>
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>
165
+ </div>
166
+ </body>
167
+ <script type="text/javascript" src="../data/expand.js"> _ <!-- underscore character is required to prevent converting to <script /> which does not work --> </script>
168
+ </html>
169
+ <xsl:call-template name="expand_it"/>
170
+ </xsl:template>
171
+ <xsl:template name="expand_it">
172
+ <script language="JavaScript"></script>
173
+ </xsl:template>
174
+ </xsl:stylesheet>
@@ -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:
@@ -0,0 +1,213 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <!--
4
+ # Copyright IBM Corp. 2024 - 2024
5
+ # SPDX-License-Identifier: Apache-2.0
6
+ -->
7
+
8
+ <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
9
+ <xsl:template match="text()"/> <!-- these are not the threads you're looking for -->
10
+ <xsl:template match="/index/doc/Thread/all_snapshot_collection/snapshot_collection[thread_hash='{id}']">
11
+ <html height="100%">
12
+ <head>
13
+ <link rel="stylesheet" href="../data/style.css"/>
14
+ <link rel="stylesheet" href="../data/jquery/jq.css" />
15
+ <link rel="stylesheet" href="../data/jquery/theme.blue.css" />
16
+ <link rel="stylesheet" href="../data/jquery/theme.default.min.css" />
17
+ <script type="text/javascript" src="../data/jquery/jquery.min.js"> _ </script>
18
+ <script type="text/javascript" src="../data/jquery/jquery.tablesorter.min.js"> _ </script>
19
+ <script type="text/javascript" src="../data/jquery/jquery.tablesorter.widgets.min.js"> _ </script>
20
+ <script type="text/javascript" src="../data/jquery/chart.js"> _ </script>
21
+ <script type="text/javascript" src="../data/jquery/chartjs-adapter-date-fns.bundle.min.js"> _ </script>
22
+ <script type="text/javascript" src="../data/jquery/wait2scripts.js"> _ </script>
23
+ <script src="../data/jquery/jquery.mark.min.js"> _ </script>
24
+ <script type="text/javascript" src="../data/jquery/search.js"> _ </script>
25
+ </head>
26
+ <body id="doc_body" height="100%">
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>
72
+ <xsl:when test="position()=1">
73
+ <td>N/A</td>
74
+ </xsl:when>
75
+ <xsl:otherwise>
76
+ <td>
77
+ <xsl:value-of select='format-number(elapsed_time, "0.##")'/>
78
+ </td>
79
+ </xsl:otherwise>
80
+ </xsl:choose>
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>
92
+ </xsl:when>
93
+ <xsl:otherwise>
94
+ <td><xsl:value-of select='format-number(cpu_percentage, "0.#")'/></td>
95
+ </xsl:otherwise>
96
+ </xsl:choose>
97
+ <td class="left">
98
+ <div>
99
+ <xsl:choose>
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>
113
+ </xsl:when>
114
+ <xsl:otherwise>
115
+ No Stack
116
+ </xsl:otherwise>
117
+ </xsl:choose>
118
+ </div>
119
+ </td>
120
+ <xsl:choose>
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>
203
+ </div>
204
+ </body>
205
+ <script>loadChart();</script>
206
+ <script type="text/javascript" src="../data/expand.js"> _ <!-- underscore character is required to prevent converting to <script /> which does not work --> </script>
207
+ </html>
208
+ <xsl:call-template name="expand_it"/>
209
+ </xsl:template>
210
+ <xsl:template name="expand_it">
211
+ <script language="JavaScript"></script>
212
+ </xsl:template>
213
+ </xsl:stylesheet>
@@ -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