Skip to content

Commit

Permalink
Merge pull request #76 from IBM/Different_Time_range_on_GC_activity_a…
Browse files Browse the repository at this point in the history
…nd_CPU_load_graphs

Different time range on gc activity and cpu load graphs
  • Loading branch information
kkazmierczyk authored Dec 31, 2024
2 parents c1af3b3 + f053bbc commit 23d5aba
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 22 deletions.
6 changes: 4 additions & 2 deletions src/javacore_analyser/data/jquery/wait2scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ const loadChartGC = function() {
}

const sysResourceE3Elem = document.getElementById('systemresources_myChartGC');
sysResourceE3Elem.classList.remove('hide');
if (sysResourceE3Elem) {
sysResourceE3Elem.classList.remove('hide');
}

const ctx = document.getElementById('myChartGC');

Expand All @@ -125,7 +127,7 @@ const loadChartGC = function() {
startingPoint = timestamp;

if(endingPoint < timestamp)
endingPoint > timestamp;
endingPoint = timestamp;
}

coresTimeRange['startTime'] = startingPoint;
Expand Down
54 changes: 35 additions & 19 deletions src/javacore_analyser/data/xml/report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -355,25 +355,41 @@
<h4>Garbage Collection Activity</h4>
<a id="togglememusagedoc" href="javascript:expand_it(memusagedoc,togglememusagedoc)" class="expandit">
What does this chart tell me?</a>
<div id="memusagedoc" style="display:none;">
This chart shows all the garbage collections that happened between the time
of the first and the last javacore in the data set.
Garbage collections that happened before the first
or after the last javacore generation time are not included.
<ul>
<li><strong>Heap Usage</strong>
is the available Java heap memory over time,
based on the garbage collection data from the verbose GC log files.
</li>
<li><strong>Total Heap</strong>
is the maximum size of the Java heap, configured by using the Xmx Java argument,
expressed in megabytes.
</li>
</ul>
</div>
<div id="systemresources_myChartGC" class="chart-container hide">
<canvas id="myChartGC" height="200"></canvas>
</div>
<xsl:choose>
<xsl:when test="doc/report_info/verbose_gc_list/verbose_gc">
<xsl:choose>
<xsl:when test="//verbose_gc_list/@total_collects_in_time_limits = 0">
<br/>
There were no garbage collections withing the javacore time limits
</xsl:when>
<xsl:otherwise>
<div id="memusagedoc" style="display:none;">
This chart shows all the garbage collections that happened between the time
of the first and the last javacore in the data set.
Garbage collections that happened before the first
or after the last javacore generation time are not included.
<ul>
<li><strong>Heap Usage</strong>
is the available Java heap memory over time,
based on the garbage collection data from the verbose GC log files.
</li>
<li><strong>Total Heap</strong>
is the maximum size of the Java heap, configured by using the Xmx Java argument,
expressed in megabytes.
</li>
</ul>
</div>
<div id="systemresources_myChartGC" class="chart-container hide">
<canvas id="myChartGC" height="200"></canvas>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<br/>
No verbosegc logs were provided
</xsl:otherwise>
</xsl:choose>
<h4>CPU Load</h4>
<a id="togglecpuloaddoc" href="javascript:expand_it(cpuloaddoc,togglecpuloaddoc)" class="expandit">
What does this chart tell me?</a>
Expand Down
4 changes: 4 additions & 0 deletions src/javacore_analyser/javacore_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def __create_report_xml(self, output_file):

verbose_gc_list_node = self.doc.createElement("verbose_gc_list")
report_info_node.appendChild(verbose_gc_list_node)

total_collects_in_time_limits = 0
for vgc in self.gc_parser.get_files():
verbose_gc_node = self.doc.createElement("verbose_gc")
verbose_gc_list_node.appendChild(verbose_gc_node)
Expand All @@ -394,9 +396,11 @@ def __create_report_xml(self, output_file):
verbose_gc_collects_node = self.doc.createElement("verbose_gc_collects")
verbose_gc_node.appendChild(verbose_gc_collects_node)
verbose_gc_collects_node.appendChild(self.doc.createTextNode(str(vgc.get_number_of_collects())))
total_collects_in_time_limits += vgc.get_number_of_collects()
verbose_gc_total_collects_node = self.doc.createElement("verbose_gc_total_collects")
verbose_gc_node.appendChild(verbose_gc_total_collects_node)
verbose_gc_total_collects_node.appendChild(self.doc.createTextNode(str(vgc.get_total_number_of_collects())))
verbose_gc_list_node.setAttribute("total_collects_in_time_limits", str(total_collects_in_time_limits))

system_info_node = self.doc.createElement("system_info")
doc_node.appendChild(system_info_node)
Expand Down
1 change: 0 additions & 1 deletion src/javacore_analyser/verbose_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def set_number_of_collects(self, number):
gets the total number of gc collections in this VerboseGcFile
regardless of the time when tey occurred with regards to the javacores
'''

def get_total_number_of_collects(self):
if self.__total_number_of_collects < 0:
self.get_collects()
Expand Down

0 comments on commit 23d5aba

Please sign in to comment.