1Z0-1067-25 Question 125
Single answerYou are tasked with monitoring the average CPU usage of each compute instance over the past hour to spot any anomalies. You decide to use Oracle Cloud Infrastructure Monitoring with Metric Query Language (MQL) to retrieve these metrics. Which of the following MQL queries will correctly show the mean CPU utilization for all instances, grouped by instanceName, over the last hour?
- A
CpuUtilization[1h].mean().group_by('instanceName')
- B
CpuUtilization.last(1h).group_by('instanceName')
- C
CpuUtilization[1h].mean() group 'instanceName'
- D
CpuUtilization[1h]{instanceName='*'}.sum()
Show answer and explanation
Correct answer: A
Explanation
In Oracle Cloud Infrastructure Monitoring, MQL allows you to query metrics over a specified time period, apply an aggregator (such as mean, sum, or last), and group results by specified dimensions. To monitor average CPU usage for each instance, you must use the 'mean()' aggregator over the 1-hour window and group by 'instanceName.' For more details, consult the OCI Monitoring documentation on MQL usage and aggregator functions.
- A. Correct.
Option 1 is correct. The query uses the mean aggregator with a 1-hour window and then groups by the instanceName dimension. This follows the standard MQL syntax, accurately capturing the average (mean) CPU utilization across all instances over the last hour.
- B. Incorrect.
Option 2 is incorrect. The 'last' aggregator returns the last data point rather than an average over the specified time window. It would not provide the mean CPU usage over the hour.
- C. Incorrect.
Option 3 is incorrect. While this option includes the mean aggregator, it has a syntax error. 'group_by' must be explicitly specified; 'group' alone is not valid in MQL, making this query invalid.
- D. Incorrect.
Option 4 is incorrect. The 'sum' aggregator calculates the total CPU usage rather than the average. Even though it correctly specifies a 1-hour period and filters on instanceName, it does not fulfill the requirement of showing the mean CPU usage.