Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Products
/
LILOM
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
2
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
ea18db9c
...
ea18db9cfbf1051d2c1077fbeadc0f492a4e3da2
authored
2019-10-09 17:30:30 +0200
by
Christian Gerdes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixes for Prometheus
1 parent
46f52baa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
36 deletions
JavaMonWeb/jetty/JavaMonWeb.war
JavaMonWeb/src/OraMonRESTgetPrometheus.java
JavaMonWeb/jetty/JavaMonWeb.war
View file @
ea18db9
No preview for this file type
JavaMonWeb/src/OraMonRESTgetPrometheus.java
View file @
ea18db9
...
...
@@ -161,42 +161,45 @@ public class OraMonRESTgetPrometheus extends HttpServlet {
// Now return the metrics in Prometheus format
sb
.
append
(
"Cpu Usage (%){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Logical Reads (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getLogicalReadsPerSecond
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Executes (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"execute count"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"User Calls (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user calls"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Cache Hit Ratio (%){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCacheHitRatioPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Redo Size (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"redo size"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"OS Busy (%){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsBusyPercent
()
+
"}"
);
sb
.
append
(
"OS Load (#){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsLoad
()
+
"}"
);
sb
.
append
(
"OS Page In (KB/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"VM_IN_BYTES"
,
OraMon
.
OSSTAT
)/
1024
+
"\n"
);
sb
.
append
(
"OS Page Out (KB/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"VM_OUT_BYTES"
,
OraMon
.
OSSTAT
)/
1024
+
"\n"
);
sb
.
append
(
"OS Load per Cpu (#){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsLoadPerCPU
()
+
"\n"
);
sb
.
append
(
"Consistent Gets (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"consistent gets"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"DB Block Gets (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"db block gets"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Buffer Cache Hit Ratio (%){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getBufferCacheHitRatioPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"DB Block Changes (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"db block changes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Physical Reads (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"physical reads"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Physical Writes (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"physical writes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Redo Writes (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"redo writes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Non-idle Wait Time (ms/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"non-idle wait time"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"File I/O Wait Time (ms/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"file io wait time"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"User Commits (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user commits"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"User Rollbacks (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user rollbacks"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Parse Count Total (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"parse count (total)"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Parse Count Hard (#/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"parse count (hard)"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Cpu Usage xNIWT (%){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUPercent
(
true
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Cpu Time (us/s){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUTimePerSecond
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Cpus (#){pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getNumberOfCPUs
()
+
"\n"
);
sb
.
append
(
"OraMon Response Time{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getLastRTms
()
+
"\n"
);
sb
.
append
(
"OraMon Blocked{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getBlockedState
()
+
"\n"
);
sb
.
append
(
"OraMon Age{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getAgeTs
()
+
"\n"
);
sb
.
append
(
"CpuUsage{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"LogicalReads{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getLogicalReadsPerSecond
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Executes{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"execute count"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"UserCalls{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user calls"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"CacheHitRatio{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCacheHitRatioPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"RedoSize{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"redo size"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"OSBusy{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsBusyPercent
()
+
"\n"
);
sb
.
append
(
"OSLoad{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsLoad
()
+
"\n"
);
sb
.
append
(
"OSPageIn{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"VM_IN_BYTES"
,
OraMon
.
OSSTAT
)/
1024
+
"\n"
);
sb
.
append
(
"OSPageOut{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"VM_OUT_BYTES"
,
OraMon
.
OSSTAT
)/
1024
+
"\n"
);
sb
.
append
(
"OSLoadperCpu{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsLoadPerCPU
()
+
"\n"
);
sb
.
append
(
"ConsistentGets{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"consistent gets"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"DBBlockGets{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"db block gets"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"BufferCacheHitRatio{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getBufferCacheHitRatioPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"DBBlockChanges{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"db block changes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"PhysicalReads{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"physical reads"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"PhysicalWrites{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"physical writes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"RedoWrites{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"redo writes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"NonidleWaitTime{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"non-idle wait time"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"FileIOWaitTime{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"file io wait time"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"UserCommits{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user commits"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"UserRollbacks{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user rollbacks"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"ParseCountTotal{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"parse count (total)"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"ParseCountHard{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"parse count (hard)"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"CpuUsagexNIWT{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUPercent
(
true
,
pdbName
)
+
"\n"
);
sb
.
append
(
"CpuTime{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUTimePerSecond
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Cpus{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getNumberOfCPUs
()
+
"\n"
);
sb
.
append
(
"OraMonResponseTime{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getLastRTms
()
+
"\n"
);
if
(
monitor
.
getBlockedState
())
sb
.
append
(
"OraMonBlocked{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} 1\n"
);
else
sb
.
append
(
"OraMonBlocked{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} 0\n"
);
sb
.
append
(
"OraMonAge{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getAgeTs
()
+
"\n"
);
}
}
else
{
...
...
Please
register
or
sign in
to post a comment