Extensions
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OracleDB metric com.dynatrace.extension.sql-oracle.cpu.foregroundTotal

Georgi_Vuldzhev
Contributor

Hi everyone!

I am struggling with two metrics in DT Managed. I looked around the threads but couldn't find something related to my issue. :face_with_monocle:

So, here's what I am trying to understand. We installed an OracleDB extension in DT to monitor the performance of our DBs. In the metrics that we get from the extension I see the following two:


com.dynatrace.extension.sql-oracle.cpu.backgroundTotal
com.dynatrace.extension.sql-oracle.cpu.foregroundTotal

They show a number of the Foreground/Background CPU Usage/per second. It didn't mean anything to me (probably because I know almost nothing about DBs). So I checked it up and it seems the dimention of this value is CPU usage of foreground/background processes in centi seconds per second...😮

I hope it doesn't sound (too) stupid but as far as I know we have 100 centi seconds in a second, while the number shown by these metrics is in the range of 500-600-700 (of course constantly changing). 

Can someone explain to me what it actually means?

Also, the other fun part is that the DB team who will use these data for performance analysis wants to see this CPU usage in % and not this strange value. Is there a similar metric that I can use or a way to aggregate it from this one? I assume it wouldn't be sufficient to have only the host CPU usage.

Georgi_Vuldzhev_0-1742488438425.png

 


Thanks a lot to everyone who will ease my pain! 

All the best,
Georgi

Dynatrace Associate | Monitoring Engineer | SME
1 REPLY 1

TomásSeroteRoos
Dynatrace Advisor
Dynatrace Advisor

Hi Georgi,

The foreground and background CPU usage metrics are coming from this query:

          SELECT
                DECODE(metric_name, 'Background CPU Usage Per Sec', gv$metric.value) AS background_cpu_usage,
                DECODE(metric_name, 'CPU Usage Per Sec', gv$metric.value) AS foreground_cpu_usage,
                gv$instance.instance_name
          FROM
                gv$metric JOIN gv$metricgroup
                  ON gv$metric.group_id = gv$metricgroup.group_id AND gv$metric.inst_id = gv$metricgroup.inst_id
                  AND gv$metric.metric_name IN ('Background CPU Usage Per Sec', 'CPU Usage Per Sec')
          JOIN gv$instance
                ON gv$instance.inst_id = gv$metric.inst_id

This is essentially going on the V$METRIC view and pulling what Oracle reports as CPU usage per second.

Centiseconds per second tells you how many hundredths of CPU seconds you are using each second. It does not directly correspond to a percentage, since with multiple cores, you could have more than 100 CPU centiseconds being used. For example, if you have 4 cores, you could have CPU time up to 400 centiseconds in a second. This is similar to what UNIX reports as CPU time, if you are familiar with that concept.

To get a percentage value, I would recommend either dividing the CPU usage metrics by the com.dynatrace.extension.sql-oracle.cpu.cores metric, which gives you the number of CPU cores, or use the process CPU percentage metric reported by the OneAgent.

Let me know if that cleared it up!

Sorry for the late reply, this only made it to my desk today. But better late than never 🙂

Featured Posts