Showing
6 changed files
with
17 additions
and
5 deletions
No preview for this file type
No preview for this file type
... | @@ -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 | return 100*(busy/(busy+idle)); | 81 | if(idle != 0 && busy != 0) |
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)); |
108 | return buffCacheHitRatio * 100; | 111 | if(buffCacheHitRatio > 0) |
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)); |
122 | return cacheHitRatio * 100; | 129 | if(cacheHitRatio > 0) |
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 { | ... | ... |
-
Please register or sign in to post a comment