Commit 0694b33b 0694b33bc26f159769db268dac1b5eeb12178734 by Christian Gerdes

New version with page in and out counters for issue #1 and bug fix for

issue #2
1 parent 43d890cf
1 java -jar jetty-runner-9.2.9.v20150224.jar --log access.log --out systemout.log JavaMonWeb.war 1 java -jar jetty-runner-9.2.9.v20150224.jar JavaMonWeb.war
2 pause 2 pause
...\ No newline at end of file ...\ No newline at end of file
......
1 java -jar jetty-runner-9.3.7.v20160115.jar --log access.log --out systemout.log JavaMonWeb.war 1 java -jar jetty-runner-9.3.7.v20160115.jar JavaMonWeb.war
2 pause 2 pause
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -80,6 +80,8 @@ public class OraMonRESTgetMetrics extends HttpServlet { ...@@ -80,6 +80,8 @@ public class OraMonRESTgetMetrics extends HttpServlet {
80 sb.append(",{\"name\":\"Cpu Usage (%)" + aStr + "\",\"value\":" + item.getCPUPercent() + "}"); 80 sb.append(",{\"name\":\"Cpu Usage (%)" + aStr + "\",\"value\":" + item.getCPUPercent() + "}");
81 sb.append(",{\"name\":\"OS Busy (%)" + aStr + "\",\"value\":" + item.getOsBusyPercent() + "}"); 81 sb.append(",{\"name\":\"OS Busy (%)" + aStr + "\",\"value\":" + item.getOsBusyPercent() + "}");
82 sb.append(",{\"name\":\"OS Load (#)" + aStr + "\",\"value\":" + item.getOsLoad() + "}"); 82 sb.append(",{\"name\":\"OS Load (#)" + aStr + "\",\"value\":" + item.getOsLoad() + "}");
83 sb.append(",{\"name\":\"OS Page In (KB/s)" + aStr + "\",\"value\":" + item.getPerSecondValue("VM_IN_BYTES", 2)/1024 + "}");
84 sb.append(",{\"name\":\"OS Page Out (KB/s)" + aStr + "\",\"value\":" + item.getPerSecondValue("VM_OUT_BYTES", 2)/1024 + "}");
83 sb.append(",{\"name\":\"OS Load per Cpu (#)" + aStr + "\",\"value\":" + item.getOsLoadPerCPU() + "}"); 85 sb.append(",{\"name\":\"OS Load per Cpu (#)" + aStr + "\",\"value\":" + item.getOsLoadPerCPU() + "}");
84 sb.append(",{\"name\":\"Logical Reads (#/s)" + aStr + "\",\"value\":" + item.getLogicalReadsPerSecond() + "}"); 86 sb.append(",{\"name\":\"Logical Reads (#/s)" + aStr + "\",\"value\":" + item.getLogicalReadsPerSecond() + "}");
85 sb.append(",{\"name\":\"Consistent Gets (#/s)" + aStr + "\",\"value\":" + item.getPerSecondValue("consistent gets") + "}"); 87 sb.append(",{\"name\":\"Consistent Gets (#/s)" + aStr + "\",\"value\":" + item.getPerSecondValue("consistent gets") + "}");
......
...@@ -78,7 +78,10 @@ public class OraMon { ...@@ -78,7 +78,10 @@ public class OraMon {
78 public double getOsBusyPercent() throws Throwable { 78 public double getOsBusyPercent() throws Throwable {
79 double idle = getPerSecondValue("IDLE_TIME", OSSTAT); 79 double idle = getPerSecondValue("IDLE_TIME", OSSTAT);
80 double busy = getPerSecondValue("BUSY_TIME", OSSTAT); 80 double busy = getPerSecondValue("BUSY_TIME", OSSTAT);
81 if(idle != 0 && busy != 0)
81 return 100*(busy/(busy+idle)); 82 return 100*(busy/(busy+idle));
83 else
84 return 0;
82 } 85 }
83 86
84 // OS LOAD 87 // OS LOAD
...@@ -105,7 +108,11 @@ public class OraMon { ...@@ -105,7 +108,11 @@ public class OraMon {
105 return 0; 108 return 0;
106 } 109 }
107 double buffCacheHitRatio = 1 - (physReadsCache/(conGetsCache + dbBlocksCache)); 110 double buffCacheHitRatio = 1 - (physReadsCache/(conGetsCache + dbBlocksCache));
111 if(buffCacheHitRatio > 0)
108 return buffCacheHitRatio * 100; 112 return buffCacheHitRatio * 100;
113 else
114 return 0;
115
109 } 116 }
110 117
111 public double getCacheHitRatioPercent() throws Throwable { 118 public double getCacheHitRatioPercent() throws Throwable {
...@@ -119,7 +126,10 @@ public class OraMon { ...@@ -119,7 +126,10 @@ public class OraMon {
119 return 0; 126 return 0;
120 } 127 }
121 double cacheHitRatio = 1 - (physReads/(conGets + dbBlocks)); 128 double cacheHitRatio = 1 - (physReads/(conGets + dbBlocks));
129 if(cacheHitRatio > 0)
122 return cacheHitRatio * 100; 130 return cacheHitRatio * 100;
131 else
132 return 0;
123 } 133 }
124 134
125 public double getLogicalReadsPerSecond() throws Throwable { 135 public double getLogicalReadsPerSecond() throws Throwable {
......