Bug fixes for Prometheus
Showing
2 changed files
with
39 additions
and
36 deletions
No preview for this file type
... | @@ -161,42 +161,45 @@ public class OraMonRESTgetPrometheus extends HttpServlet { | ... | @@ -161,42 +161,45 @@ public class OraMonRESTgetPrometheus extends HttpServlet { |
161 | 161 | ||
162 | // Now return the metrics in Prometheus format | 162 | // Now return the metrics in Prometheus format |
163 | 163 | ||
164 | sb.append("Cpu Usage (%){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCPUPercent(pdbName) + "\n"); | 164 | sb.append("CpuUsage{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCPUPercent(pdbName) + "\n"); |
165 | sb.append("Logical Reads (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getLogicalReadsPerSecond(pdbName) + "\n"); | 165 | sb.append("LogicalReads{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getLogicalReadsPerSecond(pdbName) + "\n"); |
166 | sb.append("Executes (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("execute count",pdbName) + "\n"); | 166 | sb.append("Executes{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("execute count",pdbName) + "\n"); |
167 | sb.append("User Calls (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("user calls",pdbName) + "\n"); | 167 | sb.append("UserCalls{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("user calls",pdbName) + "\n"); |
168 | sb.append("Cache Hit Ratio (%){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCacheHitRatioPercent(pdbName) + "\n"); | 168 | sb.append("CacheHitRatio{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCacheHitRatioPercent(pdbName) + "\n"); |
169 | sb.append("Redo Size (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("redo size",pdbName) + "\n"); | 169 | sb.append("RedoSize{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("redo size",pdbName) + "\n"); |
170 | 170 | ||
171 | sb.append("OS Busy (%){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getOsBusyPercent() + "}"); | 171 | sb.append("OSBusy{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getOsBusyPercent() + "\n"); |
172 | sb.append("OS Load (#){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getOsLoad() + "}"); | 172 | sb.append("OSLoad{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getOsLoad() + "\n"); |
173 | sb.append("OS Page In (KB/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("VM_IN_BYTES", OraMon.OSSTAT)/1024 + "\n"); | 173 | sb.append("OSPageIn{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("VM_IN_BYTES", OraMon.OSSTAT)/1024 + "\n"); |
174 | sb.append("OS Page Out (KB/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("VM_OUT_BYTES", OraMon.OSSTAT)/1024 + "\n"); | 174 | sb.append("OSPageOut{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("VM_OUT_BYTES", OraMon.OSSTAT)/1024 + "\n"); |
175 | sb.append("OS Load per Cpu (#){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getOsLoadPerCPU() + "\n"); | 175 | sb.append("OSLoadperCpu{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getOsLoadPerCPU() + "\n"); |
176 | 176 | ||
177 | sb.append("Consistent Gets (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("consistent gets",pdbName) + "\n"); | 177 | sb.append("ConsistentGets{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("consistent gets",pdbName) + "\n"); |
178 | sb.append("DB Block Gets (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("db block gets",pdbName) + "\n"); | 178 | sb.append("DBBlockGets{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("db block gets",pdbName) + "\n"); |
179 | 179 | ||
180 | sb.append("Buffer Cache Hit Ratio (%){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getBufferCacheHitRatioPercent(pdbName) + "\n"); | 180 | sb.append("BufferCacheHitRatio{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getBufferCacheHitRatioPercent(pdbName) + "\n"); |
181 | sb.append("DB Block Changes (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("db block changes",pdbName) + "\n"); | 181 | sb.append("DBBlockChanges{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("db block changes",pdbName) + "\n"); |
182 | 182 | ||
183 | sb.append("Physical Reads (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("physical reads",pdbName) + "\n"); | 183 | sb.append("PhysicalReads{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("physical reads",pdbName) + "\n"); |
184 | sb.append("Physical Writes (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("physical writes",pdbName) + "\n"); | 184 | sb.append("PhysicalWrites{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("physical writes",pdbName) + "\n"); |
185 | sb.append("Redo Writes (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("redo writes",pdbName) + "\n"); | 185 | sb.append("RedoWrites{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("redo writes",pdbName) + "\n"); |
186 | sb.append("Non-idle Wait Time (ms/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("non-idle wait time",pdbName) + "\n"); | 186 | sb.append("NonidleWaitTime{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("non-idle wait time",pdbName) + "\n"); |
187 | sb.append("File I/O Wait Time (ms/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("file io wait time",pdbName) + "\n"); | 187 | sb.append("FileIOWaitTime{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("file io wait time",pdbName) + "\n"); |
188 | 188 | ||
189 | sb.append("User Commits (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("user commits",pdbName) + "\n"); | 189 | sb.append("UserCommits{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("user commits",pdbName) + "\n"); |
190 | sb.append("User Rollbacks (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("user rollbacks",pdbName) + "\n"); | 190 | sb.append("UserRollbacks{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("user rollbacks",pdbName) + "\n"); |
191 | sb.append("Parse Count Total (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("parse count (total)",pdbName) + "\n"); | 191 | sb.append("ParseCountTotal{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("parse count (total)",pdbName) + "\n"); |
192 | sb.append("Parse Count Hard (#/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("parse count (hard)",pdbName) + "\n"); | 192 | sb.append("ParseCountHard{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getPerSecondValue("parse count (hard)",pdbName) + "\n"); |
193 | sb.append("Cpu Usage xNIWT (%){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCPUPercent(true,pdbName) + "\n"); | 193 | sb.append("CpuUsagexNIWT{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCPUPercent(true,pdbName) + "\n"); |
194 | sb.append("Cpu Time (us/s){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCPUTimePerSecond(pdbName) + "\n"); | 194 | sb.append("CpuTime{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getCPUTimePerSecond(pdbName) + "\n"); |
195 | sb.append("Cpus (#){pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getNumberOfCPUs() + "\n"); | 195 | sb.append("Cpus{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getNumberOfCPUs() + "\n"); |
196 | 196 | ||
197 | sb.append("OraMon Response Time{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getLastRTms() + "\n"); | 197 | sb.append("OraMonResponseTime{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getLastRTms() + "\n"); |
198 | sb.append("OraMon Blocked{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getBlockedState() + "\n"); | 198 | if(monitor.getBlockedState()) |
199 | sb.append("OraMon Age{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getAgeTs() + "\n"); | 199 | sb.append("OraMonBlocked{pdb=\""+fName+"\", cdb=\""+dbName+"\"} 1\n"); |
200 | else | ||
201 | sb.append("OraMonBlocked{pdb=\""+fName+"\", cdb=\""+dbName+"\"} 0\n"); | ||
202 | sb.append("OraMonAge{pdb=\""+fName+"\", cdb=\""+dbName+"\"} " + monitor.getAgeTs() + "\n"); | ||
200 | 203 | ||
201 | } | 204 | } |
202 | } else { | 205 | } else { | ... | ... |
-
Please register or sign in to post a comment