Skip to main content

database_mysql_cpu_usage

Creates, updates, deletes, gets or lists a database_mysql_cpu_usage resource.

Overview

Namedatabase_mysql_cpu_usage
TypeResource
Iddigitalocean.monitoring.database_mysql_cpu_usage

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called data and status.

NameDatatypeDescription
dataobject
statusstring (success, error) (example: success)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
monitoring_get_database_mysql_cpu_usageselectdb_id, aggregate, start, endRetrieve CPU usage (percent) for a MySQL cluster. Response is a time series of cluster-level CPU usage. Use aggregate to get avg, max, or min over the range.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
aggregatestringAggregation over the time range (avg, max, or min). (example: avg)
db_idstring (uuid)The DBaaS cluster UUID (database ID). (example: 9cc10173-e9ea-4176-9dbc-a4cee4c4ff30)
endstringUNIX timestamp to end metric window. (example: 1620705417)
startstringUNIX timestamp to start metric window. (example: 1620683817)

SELECT examples

Retrieve CPU usage (percent) for a MySQL cluster. Response is a time series of cluster-level CPU usage. Use aggregate to get avg, max, or min over the range.

SELECT
data,
status
FROM digitalocean.monitoring.database_mysql_cpu_usage
WHERE db_id = '{{ db_id }}' -- required
AND aggregate = '{{ aggregate }}' -- required
AND start = '{{ start }}' -- required
AND end = '{{ end }}' -- required
;