javacore-analyser 2.4.1.dev12__py3-none-any.whl → 2.5.0__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.
@@ -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
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright IBM Corp. 2024 - 2024
2
+ # Copyright IBM Corp. 2024 - 2025
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
  #
5
5
 
@@ -122,7 +122,10 @@ class Javacore:
122
122
  if not line:
123
123
  break
124
124
  if line.startswith(ENCODING):
125
- self.__encoding = line.split(" ")[-1].strip()
125
+ # Leave the default encoding if it was not defined
126
+ # 1TICHARSET [not available]
127
+ if not line.__contains__("[not available]"):
128
+ self.__encoding = line.split(" ")[-1].strip()
126
129
  break
127
130
  file.close()
128
131
  return self.__encoding
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: javacore_analyser
3
- Version: 2.4.1.dev12
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.
@@ -1,11 +1,11 @@
1
1
  javacore_analyser/__init__.py,sha256=Sw2ZeqcI2Kx1cDDv083n1SiSY_FDRCmidTuzaN1uRSw,76
2
2
  javacore_analyser/__main__.py,sha256=wQCPgu8Gp7XczyNckNGmY30c5YMUMRByW7jrdFO0OBY,1694
3
- javacore_analyser/abstract_snapshot_collection.py,sha256=jGfd2XgujurRlKgEtlJjqNJK9sUvTdFsdgFnX9oLzt4,5589
4
- javacore_analyser/code_snapshot_collection.py,sha256=yag25_O1JOQjz2uIK2gQzaTvovINnJ4ClnNhmrbC0Fg,2776
3
+ javacore_analyser/abstract_snapshot_collection.py,sha256=ZA5rRD8YjaDJozLqT2RNMcJ_TaAfcAFjyIZasYnq9yQ,6393
4
+ javacore_analyser/code_snapshot_collection.py,sha256=vk1Tlprt6iCZLL0VDWgf-ByvE008SbmkbQFwsAsuMAk,2814
5
5
  javacore_analyser/constants.py,sha256=7-gbGLzUMIMe2UvmLT17ymmy_r_izadpAyhrEKFonP8,1054
6
6
  javacore_analyser/har_file.py,sha256=grXpfIyPek9xQ5jp3_AYOB5JDELd17o4O4rYELxWO7w,2131
7
7
  javacore_analyser/java_thread.py,sha256=J_i2O87ws8LcwUHHDBE-pcFe-bV764iOO0PU_59ckVE,5780
8
- javacore_analyser/javacore.py,sha256=oqJ-nKkZvq8xk_zlF9Z4dX61isqLRndSVLnQob_KUG4,7006
8
+ javacore_analyser/javacore.py,sha256=K6NG1iLOuel8d3fXFRpdP7XnBGfCJn1qJ9GHB7TyKyU,7187
9
9
  javacore_analyser/javacore_analyser_batch.py,sha256=hLd4J_Q7JiZlkKp57KirK3_WtMaLuLC-X293a0bA8fU,8393
10
10
  javacore_analyser/javacore_analyser_web.py,sha256=L3-BG5ljYllPkwHfKHL_yvG6m0cUjkDFdxpd6qsQDH8,6269
11
11
  javacore_analyser/javacore_set.py,sha256=5x16j8KfA_DXD3FlvKlRHfRJ2B1rj5j2EkMfb2dV3dg,33341
@@ -43,8 +43,8 @@ javacore_analyser/data/xml/javacores/javacore.xsl,sha256=puJl7CDR7FACAHbb2lTKHiw
43
43
  javacore_analyser/data/xml/threads/thread.xml,sha256=6dG89Whx1_kpEYVS_F6Upa2XuXnXorlQATFc8kD5Mfc,280
44
44
  javacore_analyser/data/xml/threads/thread.xsl,sha256=1tg5tImtr1gyZ8Q61tqIukNtm1fQ6R8YoKC3EgIjLRA,14084
45
45
  javacore_analyser/templates/index.html,sha256=c40-JY3eXG9NzPVMy14VSZFj1Yq7cuUDVUg5BWa2WY0,2466
46
- javacore_analyser-2.4.1.dev12.dist-info/METADATA,sha256=dhoPkcEsi4esNZblFoVzXwMznt3hsMm4f4KAWNCzgSY,22743
47
- javacore_analyser-2.4.1.dev12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
- javacore_analyser-2.4.1.dev12.dist-info/entry_points.txt,sha256=W3S799zI58g5-jWMsC3wY9xksz21LPEMYOILv8sayfM,160
49
- javacore_analyser-2.4.1.dev12.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
50
- javacore_analyser-2.4.1.dev12.dist-info/RECORD,,
46
+ javacore_analyser-2.5.0.dist-info/METADATA,sha256=XNjRx_kKr1WtVLY0s5yTlfyy9JeDpltQCv7R9QCayq0,24088
47
+ javacore_analyser-2.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
+ javacore_analyser-2.5.0.dist-info/entry_points.txt,sha256=W3S799zI58g5-jWMsC3wY9xksz21LPEMYOILv8sayfM,160
49
+ javacore_analyser-2.5.0.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
50
+ javacore_analyser-2.5.0.dist-info/RECORD,,