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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
30 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
(
"Cpu
Usage
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Logical
Reads
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getLogicalReadsPerSecond
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Executes{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"execute count"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"User
Calls
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user calls"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Cache
HitRatio
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCacheHitRatioPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"Redo
Size
{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
(
"OS
Busy{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsBusyPercent
()
+
"\n
"
);
sb
.
append
(
"OS
Load{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getOsLoad
()
+
"\n
"
);
sb
.
append
(
"OS
PageIn
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"VM_IN_BYTES"
,
OraMon
.
OSSTAT
)/
1024
+
"\n"
);
sb
.
append
(
"OS
PageOut
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"VM_OUT_BYTES"
,
OraMon
.
OSSTAT
)/
1024
+
"\n"
);
sb
.
append
(
"OS
LoadperCpu
{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
(
"Consistent
Gets
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"consistent gets"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"DB
BlockGets
{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
(
"Buffer
CacheHitRatio
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getBufferCacheHitRatioPercent
(
pdbName
)
+
"\n"
);
sb
.
append
(
"DB
BlockChanges
{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
(
"Physical
Reads
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"physical reads"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Physical
Writes
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"physical writes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Redo
Writes
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"redo writes"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Non
idleWaitTime
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"non-idle wait time"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"File
IOWaitTime
{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
(
"User
Commits
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user commits"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"User
Rollbacks
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"user rollbacks"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Parse
CountTotal
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"parse count (total)"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Parse
CountHard
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getPerSecondValue
(
"parse count (hard)"
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Cpu
UsagexNIWT
{pdb=\""
+
fName
+
"\", cdb=\""
+
dbName
+
"\"} "
+
monitor
.
getCPUPercent
(
true
,
pdbName
)
+
"\n"
);
sb
.
append
(
"Cpu
Time
{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
(
"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