javacore-analyser 2.4.2__tar.gz → 2.5.0__tar.gz

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.
Files changed (66) hide show
  1. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/.travis.yml +3 -1
  2. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/CHANGELOG.md +10 -0
  3. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/PKG-INFO +26 -2
  4. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/README.md +25 -1
  5. javacore_analyser-2.5.0/collectors/javacoreCollector.sh +105 -0
  6. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/abstract_snapshot_collection.py +14 -0
  7. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/code_snapshot_collection.py +8 -6
  8. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  9. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  10. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/.github/dco.yml +0 -0
  11. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/.gitignore +0 -0
  12. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/CODE_OF_CONDUCT.md +0 -0
  13. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/CONTRIBUTING.md +0 -0
  14. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/Dockerfile +0 -0
  15. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/LICENSE +0 -0
  16. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/MAINTAINERS.md +0 -0
  17. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/REQUIREMENTS.md +0 -0
  18. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/SECURITY.md +0 -0
  19. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/docs/ClassDiagram.png +0 -0
  20. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/docs/dom_example.py +0 -0
  21. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/pyproject.toml +0 -0
  22. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/renovate.json +0 -0
  23. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/requirements.txt +0 -0
  24. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/__init__.py +0 -0
  25. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/__main__.py +0 -0
  26. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/constants.py +0 -0
  27. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/expand.js +0 -0
  28. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/html/error.html +0 -0
  29. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/html/processing_data.html +0 -0
  30. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/chart.js +0 -0
  31. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/chartjs-adapter-date-fns.bundle.min.js +0 -0
  32. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/jq.css +0 -0
  33. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/jquery.mark.min.js +0 -0
  34. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/jquery.min.js +0 -0
  35. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/jquery.tablesorter.min.js +0 -0
  36. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/jquery.tablesorter.widgets.min.js +0 -0
  37. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/search.js +0 -0
  38. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/sorting.js +0 -0
  39. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/theme.blue.css +0 -0
  40. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/theme.default.min.css +0 -0
  41. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/jquery/wait2scripts.js +0 -0
  42. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/style.css +0 -0
  43. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/style.js +0 -0
  44. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/xml/index.xml +0 -0
  45. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/xml/javacores/javacore.xml +0 -0
  46. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/xml/javacores/javacore.xsl +0 -0
  47. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/xml/report.xsl +0 -0
  48. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/xml/threads/thread.xml +0 -0
  49. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/data/xml/threads/thread.xsl +0 -0
  50. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/har_file.py +0 -0
  51. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/java_thread.py +0 -0
  52. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/javacore.py +0 -0
  53. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/javacore_analyser_batch.py +0 -0
  54. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/javacore_analyser_web.py +0 -0
  55. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/javacore_set.py +0 -0
  56. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/logging_utils.py +0 -0
  57. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/properties.py +0 -0
  58. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/snapshot_collection.py +0 -0
  59. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/snapshot_collection_collection.py +0 -0
  60. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/stack_trace.py +0 -0
  61. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/stack_trace_element.py +0 -0
  62. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/stack_trace_kind.py +0 -0
  63. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/templates/index.html +0 -0
  64. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/thread_snapshot.py +0 -0
  65. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/tips.py +0 -0
  66. {javacore_analyser-2.4.2 → javacore_analyser-2.5.0}/src/javacore_analyser/verbose_gc.py +0 -0
@@ -26,7 +26,9 @@ deploy:
26
26
  - provider: releases
27
27
  edge: true
28
28
  draft: true
29
- file: dist/*
29
+ file:
30
+ - dist/*
31
+ - collectors/*
30
32
  on:
31
33
  # all_branches: true # uncomment for testing purposes
32
34
  # branch: main # uncomment on production
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.4.2] - 2025-06-16
4
+ * #156 LookupError-unknown-encoding-available by @tjanasiewicz in https://github.com/IBM/javacore-analyser/pull/157
5
+
6
+ [2.4.2]: https://github.com/IBM/javacore-analyser/releases/tag/2.4.2
7
+
8
+ ## [2.4.1] - 2025-05-20
9
+ * #142 treat any thread with a truncated stack as interesting by @PiotrAniola82 in https://github.com/IBM/javacore-analyser/pull/148
10
+
11
+ [2.4.1]: https://github.com/IBM/javacore-analyser/releases/tag/2.4.1
12
+
3
13
  ## [2.4.0] - 2025-04-24
4
14
  * Removing vagueness by @yashrajmotwani23 in https://github.com/IBM/javacore-analyser/pull/134
5
15
  * Fixed javacore drilldown does not contain thread names by @PiotrAniola82 in https://github.com/IBM/javacore-analyser/pull/136
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: javacore_analyser
3
- Version: 2.4.2
3
+ Version: 2.5.0
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
@@ -338,7 +338,31 @@ NOTE: If you get a `PermissionError: [Errno 13] Permission denied: '/reports/wai
338
338
  try specifying a different folder as the `src` parameter value or use the
339
339
  [--volume](https://docs.docker.com/engine/storage/volumes/) option instead of `--mount`. Find more on
340
340
  [Issue #140](https://github.com/IBM/javacore-analyser/issues/140#issuecomment-2757809160).
341
-
341
+
342
+
343
+ ### Running collectors
344
+ There is a collector available that will gather javacores, verbose gc and some further server configuration (`ulimit`, `ps`, memory and disk usage) for Linux systems.
345
+ Perform the following steps to run the tool:
346
+ 1. Download the collector from [javacoreCollector.sh](collectors/javacoreCollector.sh) to the machine where you want to gather data.
347
+ 2. Execute it with the following command:
348
+
349
+ `./javacoreCollector.sh libertyPath=/opt/ibm/liberty server=liberty_server_name` - for collecting diagnostic data from a java application running on an IBM WebSphere Liberty profile,
350
+
351
+ or
352
+
353
+ `./javacoreCollector.sh javaPid=12345 javacoresDir=/location/for/javacores` - for collecting diagnostic data from any java aplication.
354
+
355
+
356
+ You can add the 'count' and 'interval' parameters to specify the number of javacores (default: 10) and interval between each of them (defaul: 30s).
357
+
358
+ Type `./javacoreCollector.sh` to get more help.
359
+
360
+ After collection, the collector creates `javacores.tar.gz` file containing the following data:
361
+ * javacore files,
362
+ * Verbose gc files, if found in `javacoresDir` or `libertyPath` location,
363
+ * Ulimit settings in `ulimit.txt` file,
364
+ * output from `ps`, memory and disk usage it iteration files. This data is gathered periodically with the same interval as javacores. There is separate file created for each collection.
365
+
342
366
  <!-- The following are OPTIONAL, but strongly suggested to have in your repository. -->
343
367
  <!--
344
368
  * [dco.yml](.github/dco.yml) - This enables DCO bot for you, please take a look https://github.com/probot/dco for more details.
@@ -99,7 +99,31 @@ NOTE: If you get a `PermissionError: [Errno 13] Permission denied: '/reports/wai
99
99
  try specifying a different folder as the `src` parameter value or use the
100
100
  [--volume](https://docs.docker.com/engine/storage/volumes/) option instead of `--mount`. Find more on
101
101
  [Issue #140](https://github.com/IBM/javacore-analyser/issues/140#issuecomment-2757809160).
102
-
102
+
103
+
104
+ ### Running collectors
105
+ There is a collector available that will gather javacores, verbose gc and some further server configuration (`ulimit`, `ps`, memory and disk usage) for Linux systems.
106
+ Perform the following steps to run the tool:
107
+ 1. Download the collector from [javacoreCollector.sh](collectors/javacoreCollector.sh) to the machine where you want to gather data.
108
+ 2. Execute it with the following command:
109
+
110
+ `./javacoreCollector.sh libertyPath=/opt/ibm/liberty server=liberty_server_name` - for collecting diagnostic data from a java application running on an IBM WebSphere Liberty profile,
111
+
112
+ or
113
+
114
+ `./javacoreCollector.sh javaPid=12345 javacoresDir=/location/for/javacores` - for collecting diagnostic data from any java aplication.
115
+
116
+
117
+ You can add the 'count' and 'interval' parameters to specify the number of javacores (default: 10) and interval between each of them (defaul: 30s).
118
+
119
+ Type `./javacoreCollector.sh` to get more help.
120
+
121
+ After collection, the collector creates `javacores.tar.gz` file containing the following data:
122
+ * javacore files,
123
+ * Verbose gc files, if found in `javacoresDir` or `libertyPath` location,
124
+ * Ulimit settings in `ulimit.txt` file,
125
+ * output from `ps`, memory and disk usage it iteration files. This data is gathered periodically with the same interval as javacores. There is separate file created for each collection.
126
+
103
127
  <!-- The following are OPTIONAL, but strongly suggested to have in your repository. -->
104
128
  <!--
105
129
  * [dco.yml](.github/dco.yml) - This enables DCO bot for you, please take a look https://github.com/probot/dco for more details.
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+
3
+ #Copyright IBM Corp. 2025 - 2025
4
+ #SPDX-License-Identifier: Apache-2.0
5
+
6
+ echo "executing javacore collector script"
7
+ current=`date`
8
+ echo "Current time: $current"
9
+ for arg in "$@"; do
10
+ if [[ $arg == libertyPath=* ]]; then
11
+ libertyPath="${arg#libertyPath=}"
12
+ elif [[ $arg == javaPid=* ]]; then
13
+ javaPid="${arg#javaPid=}"
14
+ elif [[ $arg == count=* ]]; then
15
+ count="${arg#count=}"
16
+ elif [[ $arg == interval=* ]]; then
17
+ interval="${arg#interval=}"
18
+ elif [[ $arg == server=* ]]; then
19
+ server="${arg#server=}"
20
+ elif [[ $arg == javacoresDir=* ]]; then
21
+ javacoresDir="${arg#javacoresDir=}"
22
+ fi
23
+ done
24
+
25
+ # Validation
26
+ validated=false
27
+ if [ -n "${libertyPath}" ] && [ -n "${server}" ]; then
28
+ validated=true
29
+ elif [ -n "${javaPid}" ] && [ -n "${javacoresDir}" ]; then
30
+ validated=true
31
+ else
32
+ validated=false
33
+ fi
34
+ if [ "$validated" = false ]; then
35
+ echo "Invalid arguments provided."
36
+ echo "You must provide either libertyPath with server name or javaPid with javacores dir arguments:"
37
+ echo " ./javacoreCollector.sh libertyPath=/opt/ibm/liberty server=server_name"
38
+ echo " ./javacoreCollector.sh javaPid=12345 javacoresDir=/path/to/javacores"
39
+ echo ""
40
+ echo "Optional arguments:"
41
+ echo ""
42
+ echo " count - number of Javacores (default: 10)"
43
+ echo " interval - interval in seconds to gather javacores (default: 30)"
44
+ echo ""
45
+ echo "Examples:"
46
+ echo " ./javacoreCollector.sh libertyPath=/opt/ibm/liberty server=clm count=5 interval=60"
47
+ echo " ./javacoreCollector.sh javaPid=12345 javacoresDir=/my_app/javacores count=5 interval=60"
48
+ exit 1
49
+ fi
50
+
51
+ [ -z "$interval" ] && interval=30
52
+ [ -z "$count" ] && count=10
53
+
54
+
55
+ if [[ -n "$libertyPath" ]]; then
56
+ echo "Liberty path provided: $libertyPath"
57
+ javacoresDir="$libertyPath/servers/$server/"
58
+ export WLP_USER_DIR=$libertyPath
59
+ verbosegcDir="$libertyPath/servers/$server"
60
+ else
61
+ echo "Java PID provided: $javaPid"
62
+ verbosegcDir=
63
+ fi
64
+
65
+ mkdir javacore_data
66
+ echo "Ulimit" >> javacore_data/ulimit.txt
67
+ ulimit -a>>javacore_data/ulimit.txt
68
+
69
+ for i in $(seq 1 $count); do
70
+
71
+ file_name=javacore_data/iteration${i}.txt
72
+ echo "Writing current system resources usage to $file_name"
73
+ echo "List of processes">>"$file_name"
74
+ ps aux>>"$file_name"
75
+ echo "Memory usage">>"$file_name"
76
+ free -k>>"$file_name"
77
+ echo "Disk usage">>"$file_name"
78
+ df -h>>"$file_name"
79
+
80
+ echo "[$(date)] Generating javacore #$i..."
81
+ if [[ -n "$libertyPath" ]]; then
82
+ echo "Running following command: $libertyPath/wlp/bin/server javadump $server"
83
+ "$libertyPath"/wlp/bin/server javadump $server
84
+ else
85
+ kill -3 $javaPid
86
+ fi
87
+ if [ $i -lt $count ]; then
88
+ sleep $interval
89
+ fi
90
+ done
91
+
92
+
93
+ echo "Creating archive file"
94
+ #copy all javacore files newer than script starting time
95
+ cp -vf `find $javacoresDir javacore*.txt -newermt "$current"` javacore_data
96
+ #copy verbose gc files if they exist
97
+ if [ -n "$verbosegcDir" ]; then
98
+ cp -vf $libertyPath/servers/$server/verbosegc.txt* javacore_data
99
+ fi
100
+ tar -czvf javacores.tar.gz javacore_data
101
+ echo "Javacores and verbose gc data saved to javacores.tar.gz archive."
102
+ echo "Deleting javacore_data dir"
103
+ rm -rfv javacore_data
104
+
105
+ exit 1
@@ -23,6 +23,20 @@ class AbstractSnapshotCollection(abc.ABC):
23
23
  self.add(thread_snapshot)
24
24
 
25
25
  def get_xml(self, doc):
26
+ """
27
+ Creates an XML node representing a snapshot collection with various metrics.
28
+
29
+ This method constructs an XML node named 'snapshot_collection' and populates it with child nodes for different metrics.
30
+ Each child node corresponds to a specific metric, such as total CPU usage, total time, CPU percentage, average memory,
31
+ maximum Java stack depth, and average Java stack depth. The text content of each child node is set to the string representation
32
+ of the respective metric value obtained from the class instance.
33
+
34
+ Args:
35
+ doc (xml.dom.minidom.Document): The XML document object to create nodes within.
36
+
37
+ Returns:
38
+ xml.dom.minidom.Element: The root 'snapshot_collection' node with all child nodes populated.
39
+ """
26
40
  snapshot_collection_node = doc.createElement('snapshot_collection')
27
41
  # total CPU usage
28
42
  total_cpu_usage_node = doc.createElement('total_cpu_usage')
@@ -9,19 +9,21 @@ from javacore_analyser.thread_snapshot import ThreadSnapshot
9
9
 
10
10
 
11
11
  class CodeSnapshotCollection(AbstractSnapshotCollection):
12
- """
13
- returns the stack trace that is common for all the
14
- snapshots in this collection """
12
+
15
13
 
16
14
  def get_stack_trace(self):
15
+ """
16
+ returns the stack trace that is common for all the
17
+ snapshots in this collection
18
+ """
17
19
  snapshot = self.thread_snapshots[0] # they all have the same stack,
18
20
  # so we can just take the first one
19
21
  return snapshot.stack_trace
20
22
 
21
- """
22
- Returns list of the threads for which given stack appears
23
- """
24
23
  def get_threads(self):
24
+ """
25
+ Returns list of the threads for which given stack appears
26
+ """
25
27
  result = set()
26
28
  for snapshot in self.thread_snapshots:
27
29
  thread = snapshot.thread