changeset 17932:d8056188ed21

6526682: JConsole shows negative CPU Usage Reviewed-by: alanb, mchung
author nloodin
date Mon, 03 Jun 2013 16:13:44 +0200
parents 765c1e9a498a
children b18cda672b79
files jdk/src/share/classes/sun/tools/jconsole/SummaryTab.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/tools/jconsole/SummaryTab.java	Mon Jun 03 10:45:11 2013 +0200
+++ b/jdk/src/share/classes/sun/tools/jconsole/SummaryTab.java	Mon Jun 03 16:13:44 2013 +0200
@@ -360,6 +360,8 @@
                     Math.min(99F,
                              elapsedCpu / (elapsedTime * 10000F * result.nCPUs));
 
+                cpuUsage = Math.max(0F, cpuUsage);
+
                 getPlotter().addValues(result.timeStamp,
                                 Math.round(cpuUsage * Math.pow(10.0, CPU_DECIMALS)));
                 getInfoLabel().setText(Resources.format(Messages.CPU_USAGE_FORMAT,