Skip to content

Commit 1bb8245

Browse files
committed
update wait_class query so it will work in pdb/adb as well as cdb
Signed-off-by: Mark Nelson <[email protected]>
1 parent 1d4091b commit 1bb8245

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

default-metrics.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ context = "wait_time"
3333
metricsdesc = { value="Generic counter metric from v$waitclassmetric view in Oracle." }
3434
fieldtoappend= "wait_class"
3535
request = '''
36-
SELECT
37-
n.wait_class as WAIT_CLASS,
38-
round(m.time_waited/m.INTSIZE_CSEC,3) as VALUE
39-
FROM
40-
v$waitclassmetric m, v$system_wait_class n
41-
WHERE
42-
m.wait_class_id=n.wait_class_id AND n.wait_class != 'Idle'
36+
SELECT wait_class as WAIT_CLASS, sum(time_waited) as VALUE
37+
FROM gv$active_session_history
38+
where wait_class is not null
39+
and sample_time > sysdate - interval '1' hour
40+
GROUP BY wait_class;
4341
'''
4442

4543
[[metric]]

0 commit comments

Comments
 (0)