javacore-analyser 2.4.0.dev18__py3-none-any.whl → 2.4.1.dev12__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.
@@ -4,6 +4,7 @@
4
4
  #
5
5
  from javacore_analyser.abstract_snapshot_collection import AbstractSnapshotCollection
6
6
  from javacore_analyser.properties import Properties
7
+ from javacore_analyser.stack_trace import StackTrace
7
8
 
8
9
 
9
10
  class Thread(AbstractSnapshotCollection):
@@ -21,6 +22,7 @@ class Thread(AbstractSnapshotCollection):
21
22
  if self.get_avg_mem() // (1024 * 1024) > 0: return True # memory in megabytes
22
23
  if len(self.get_blocker_threads()) > 0: return True
23
24
  if len(self.get_blocking_threads()) > 0: return True
25
+ if self.has_tall_stacks(): return True
24
26
  return False
25
27
 
26
28
  def get_hash(self):
@@ -144,3 +146,9 @@ class Thread(AbstractSnapshotCollection):
144
146
 
145
147
  def get_id(self):
146
148
  return self.get_hash()
149
+
150
+ def has_tall_stacks(self):
151
+ for snapshot in self.thread_snapshots:
152
+ if snapshot.stack_trace and snapshot.stack_trace.get_java_stack_depth() > StackTrace.TRUNCATION_DEPTH:
153
+ return True
154
+ return False
@@ -146,7 +146,17 @@ def generate_javecore_set_data(files):
146
146
  javacores_temp_dir.cleanup()
147
147
 
148
148
 
149
+ # Assisted by watsonx Code Assistant
149
150
  def create_output_files_structure(output_dir):
151
+ """
152
+ Creates the output report directory structure and copies necessary files.
153
+
154
+ Args:
155
+ output_dir (str): The output directory path.
156
+
157
+ Returns:
158
+ None
159
+ """
150
160
  if not os.path.isdir(output_dir):
151
161
  os.mkdir(output_dir)
152
162
  data_output_dir = os.path.normpath(os.path.join(output_dir, 'data'))
@@ -164,7 +174,18 @@ def create_output_files_structure(output_dir):
164
174
  os.path.join(output_dir, "index.html"))
165
175
 
166
176
 
177
+ # Assisted by watsonx Code Assistant
167
178
  def generate_error_page(output_dir, exception):
179
+ """
180
+ Generate an error page with a stacktrace.
181
+
182
+ Args:
183
+ output_dir (str): The directory where the error page will be saved.
184
+ exception (Exception): The exception that caused the error.
185
+
186
+ Returns:
187
+ None
188
+ """
168
189
  error_page_text = importlib_resources.read_text("javacore_analyser", "data/html/error.html")
169
190
  tb = traceback.format_exc()
170
191
  file = os.path.join(output_dir, "index.html")
@@ -52,7 +52,17 @@ def dir_listing(path):
52
52
 
53
53
 
54
54
  @app.route('/zip/<path:path>')
55
+ # Assisted by watsonx Code Assistant
55
56
  def compress(path):
57
+ """
58
+ Compress a directory and return the compressed file as an attachment.
59
+
60
+ Args:
61
+ path (str): The path to the directory to compress.
62
+
63
+ Returns:
64
+ send_from_directory: The compressed file as an attachment.
65
+ """
56
66
  temp_zip_dir = tempfile.TemporaryDirectory()
57
67
  try:
58
68
  temp_zip_dir_name = temp_zip_dir.name
@@ -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
 
@@ -10,6 +10,7 @@ from javacore_analyser.stack_trace_kind import StackTraceKind
10
10
  class StackTrace:
11
11
  java_stack_depth: int
12
12
  EMPTY_STACK = "No stack"
13
+ TRUNCATION_DEPTH = 50 # as per https://github.ibm.com/IOT-ELM-Poznan/Wait2/issues/430
13
14
 
14
15
  """
15
16
  how many first lines of the stack need to be equal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: javacore_analyser
3
- Version: 2.4.0.dev18
3
+ Version: 2.4.1.dev12
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
@@ -333,6 +333,11 @@ The `mount` option specifies where you want locally to store the reports. The re
333
333
  restart.
334
334
  The application is running in the container on port 5000. By using `-p 5001:5000` option, you specify to map container
335
335
  port 5000 to port 5001 on your machine. Therefore the application will be available under `http://localhost:5001/`.
336
+
337
+ NOTE: If you get a `PermissionError: [Errno 13] Permission denied: '/reports/wait2-debug.log'` message,
338
+ try specifying a different folder as the `src` parameter value or use the
339
+ [--volume](https://docs.docker.com/engine/storage/volumes/) option instead of `--mount`. Find more on
340
+ [Issue #140](https://github.com/IBM/javacore-analyser/issues/140#issuecomment-2757809160).
336
341
 
337
342
  <!-- The following are OPTIONAL, but strongly suggested to have in your repository. -->
338
343
  <!--
@@ -4,16 +4,16 @@ javacore_analyser/abstract_snapshot_collection.py,sha256=jGfd2XgujurRlKgEtlJjqNJ
4
4
  javacore_analyser/code_snapshot_collection.py,sha256=yag25_O1JOQjz2uIK2gQzaTvovINnJ4ClnNhmrbC0Fg,2776
5
5
  javacore_analyser/constants.py,sha256=7-gbGLzUMIMe2UvmLT17ymmy_r_izadpAyhrEKFonP8,1054
6
6
  javacore_analyser/har_file.py,sha256=grXpfIyPek9xQ5jp3_AYOB5JDELd17o4O4rYELxWO7w,2131
7
- javacore_analyser/java_thread.py,sha256=nDFJiFQSO78jP9YdMpBr2d_M2RMT0te_kJxn5KY_RNo,5437
7
+ javacore_analyser/java_thread.py,sha256=J_i2O87ws8LcwUHHDBE-pcFe-bV764iOO0PU_59ckVE,5780
8
8
  javacore_analyser/javacore.py,sha256=oqJ-nKkZvq8xk_zlF9Z4dX61isqLRndSVLnQob_KUG4,7006
9
- javacore_analyser/javacore_analyser_batch.py,sha256=2JnRruA0jazWHspT60cXX-Yuwf4vFSA5ywXYPQ4-ZiM,7888
10
- javacore_analyser/javacore_analyser_web.py,sha256=RVOtHewraQ3YhDPOI_IWqWn_aoA5a45AYOx0ZtG5-HA,5990
9
+ javacore_analyser/javacore_analyser_batch.py,sha256=hLd4J_Q7JiZlkKp57KirK3_WtMaLuLC-X293a0bA8fU,8393
10
+ javacore_analyser/javacore_analyser_web.py,sha256=L3-BG5ljYllPkwHfKHL_yvG6m0cUjkDFdxpd6qsQDH8,6269
11
11
  javacore_analyser/javacore_set.py,sha256=5x16j8KfA_DXD3FlvKlRHfRJ2B1rj5j2EkMfb2dV3dg,33341
12
12
  javacore_analyser/logging_utils.py,sha256=vLob0ikezysjGv9XGqv9GbLekxu4eO_csq22M-gtLiQ,966
13
13
  javacore_analyser/properties.py,sha256=SVxe86mL4DM_vkPEBT-V0_xDeIbXp2vjYE1aD-Z_UCQ,805
14
14
  javacore_analyser/snapshot_collection.py,sha256=fLEnwg9-cOjVVUUludtzI7R2yO9BBVgJgxkhvqG5QDg,443
15
15
  javacore_analyser/snapshot_collection_collection.py,sha256=1PV1TX4QQk01dAbX-k-kTpgKr6Il867Bw6X7HHBuv-Q,1346
16
- javacore_analyser/stack_trace.py,sha256=8sb8z4ac_L0yyxqJX1ukrTZRyngkHcA3zkXyqxG5ygA,1664
16
+ javacore_analyser/stack_trace.py,sha256=RLCbC8hLPSE_HOb3vNVP2YA38fGJMK3oB8wkrcpaf4s,1755
17
17
  javacore_analyser/stack_trace_element.py,sha256=pZPrK1ACBUDE7YsVOFhTfewXequ1m5P-B0N-9RuhkWo,1143
18
18
  javacore_analyser/stack_trace_kind.py,sha256=lOdfb_F3XrwDLciPk_ZgM_fmMn5JoXsIUjr7pjvmU4M,157
19
19
  javacore_analyser/thread_snapshot.py,sha256=yp7uJwF5adMN2UAhOn-lLtSP2X3j8utUfafjyKu8r4E,13252
@@ -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.0.dev18.dist-info/METADATA,sha256=OviivZB001U1tDP3zNn7-RiHSrfa2_1jUFuU6CgFpkc,22370
47
- javacore_analyser-2.4.0.dev18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
- javacore_analyser-2.4.0.dev18.dist-info/entry_points.txt,sha256=W3S799zI58g5-jWMsC3wY9xksz21LPEMYOILv8sayfM,160
49
- javacore_analyser-2.4.0.dev18.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
50
- javacore_analyser-2.4.0.dev18.dist-info/RECORD,,
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,,