Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Where is the actual queries that are running from the default metrics? #421

Open
1 of 2 tasks
beefcake8u opened this issue Mar 8, 2024 · 1 comment
Open
1 of 2 tasks

Comments

@beefcake8u
Copy link

I'm submitting a Question

  • bug report
  • feature request
    I am a DBA - where are the queries for the default metrics located, if you go to default metrics.toml file it only shows 5 or 6 metrics NOT the other 20 or so, Where are these located in order to see for example what the query for oracledb_wait_time_concurrency may be

Version: X.Y.Z

@afilippov-re
Copy link

Queries in default-metrics.tom utilizes Oracle's dynamic performance views (known as v$ views). These views contain data about the current state of the database, making them extremely useful for monitoring and diagnostics, for example:

SELECT
  n.wait_class as WAIT_CLASS,
  round(m.time_waited/m.INTSIZE_CSEC,3) as VALUE
FROM
  v$waitclassmetric  m, v$system_wait_class n
WHERE
  m.wait_class_id=n.wait_class_id AND n.wait_class != 'Idle'

v$waitclassmetric (alias m): This view provides metrics on wait classes. It includes columns such as wait_class_id and time_waited.
v$system_wait_class (alias n): This view describes the various wait classes, such as Concurrency, Administrative, etc. Key columns here are wait_class_id and wait_class.
SELECT: The query selects the wait class (wait_class) and calculates the value (VALUE), which is the total wait time divided by the time interval in hundredths of a second (INTSIZE_CSEC), rounded to three decimal places. This provides a measure of the average wait time in that class for the interval.
WHERE: The filter condition excludes wait classes classified as Idle. The Idle class generally means that the database processes are not busy executing tasks or waiting for resources; they are idle.

If you run the query from default-metrics.toml manually, you'll see the values you're looking for:

result:
WAIT_CLASS VALUE
Other 0.001
Application 0
Configuration 0
Administrative 0
Concurrency 0
Commit 0.001
Network 0
User I/O 0
System I/O 0.002

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants