You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
request = "SELECT instance_number AS inst_id, host_name AS node_name, instance_name, (SYSDATE - startup_time) * 86400 AS seconds FROM v$instance"
6
+
1
7
[[metric]]
2
8
context = "sessions"
3
9
labels = [ "status", "type" ]
@@ -16,9 +22,9 @@ ignorezeroresult = true
16
22
17
23
[[metric]]
18
24
context = "asm_diskgroup"
19
-
labels = [ "name" ]
20
-
metricsdesc = { total = "Total size of ASM disk group.", free = "Free space available on ASM disk group."}
21
-
request = "SELECT name,total_mb*1024*1024 as total,free_mb*1024*1024 as free FROM v$asm_diskgroup_stat where exists (select 1 from v$datafile where name like '+%')"
25
+
labels = [ "diskgroup_name" ]
26
+
metricsdesc = { total = "Total size of ASM disk group.", free = "Free space available on ASM disk group.", usage = "Percentage of ASM disk group used."}
27
+
request = "SELECT name as diskgroup_name,total_mb*1024*1024 as total,free_mb*1024*1024 as free, (1 - free_mb / total_mb) * 100 as usage FROM v$asm_diskgroup_stat where exists (select 1 from v$datafile where name like '+%')"
22
28
ignorezeroresult = true
23
29
24
30
[[metric]]
@@ -34,19 +40,17 @@ request = "SELECT COUNT(*) as count FROM v$process"
34
40
35
41
[[metric]]
36
42
context = "wait_time"
37
-
labels = ["wait_class","con_id"]
38
-
metricsdesc = { time_waited_sec_total="counter metric from system_wait_class view in Oracle." }
metricsdesc = { value="Generic counter metric from v$waitclassmetric view in Oracle." }
40
44
fieldtoappend= "wait_class"
41
45
request = '''
42
-
select
43
-
wait_class,
44
-
round(time_waited/100,3) time_waited_sec_total,
45
-
con_id
46
-
from v$system_wait_class
47
-
where wait_class <> 'Idle'
46
+
SELECT
47
+
n.wait_class as WAIT_CLASS,
48
+
round(m.time_waited*10/(m.INTSIZE_CSEC),3) as VALUE
49
+
FROM
50
+
v$waitclassmetric m, v$system_wait_class n
51
+
WHERE
52
+
m.wait_class_id=n.wait_class_id AND n.wait_class != 'Idle'
48
53
'''
49
-
ignorezeroresult = true
50
54
51
55
[[metric]]
52
56
context = "tablespace"
@@ -65,6 +69,31 @@ WHERE dtum.tablespace_name = dt.tablespace_name
65
69
ORDER by tablespace
66
70
'''
67
71
72
+
73
+
[[metric]]
74
+
context = "pga"
75
+
metricsdesc = { total = "Generic counter metric of aggregate PGA target parameter in Oracle.", used = "Generic counter metric of total PGA allocated in Oracle.", used_percent = "Gauge metric showing as a percentage of how much of the PGA has been used." }
76
+
request = '''
77
+
SELECT
78
+
(SELECT value FROM v$pgastat WHERE name = 'aggregate PGA target parameter') AS total,
79
+
(SELECT value FROM v$pgastat WHERE name = 'total PGA allocated') AS used,
80
+
(SELECT value FROM v$pgastat WHERE name = 'total PGA allocated') / (SELECT value FROM v$pgastat WHERE name = 'aggregate PGA target parameter') * 100 AS used_percent
81
+
FROM
82
+
dual
83
+
'''
84
+
85
+
[[metric]]
86
+
context = "sga"
87
+
metricsdesc = { total = "Generic counter metric of total SGA size in Oracle.", free = "Generic counter metric of free SGA memory in Oracle.", used_percent = "Gauge metric showing as a percentage of how much of the SGA has been used." }
88
+
request = '''
89
+
SELECT
90
+
(SELECT SUM(value) FROM v$sga) AS total,
91
+
(SELECT SUM(bytes) FROM v$sgastat WHERE name = 'free memory') AS free,
92
+
((SELECT SUM(value) FROM v$sga) - (SELECT SUM(bytes) FROM v$sgastat WHERE name = 'free memory')) / (SELECT SUM(value) FROM v$sga) * 100 AS used_percent
0 commit comments