Skip to main content

database_mysql_load

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

Overview

Namedatabase_mysql_load
TypeResource
Iddigitalocean.monitoring.database_mysql_load

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_loadselectdb_id, metric, aggregate, start, endRetrieve load metrics for a MySQL cluster. Use metric for the window: load1 (1-minute), load5 (5-minute), or load15 (15-minute). Use aggregate to get either the average (avg) or maximum (max) over that window over the time 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 or max). (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)
metricstringLoad window: load1 (1-minute), load5 (5-minute), load15 (15-minute). The value is either average or max over that window, depending on the aggregate parameter (avg or max). (example: load1)
startstringUNIX timestamp to start metric window. (example: 1620683817)

SELECT examples

Retrieve load metrics for a MySQL cluster. Use metric for the window: load1 (1-minute), load5 (5-minute), or load15 (15-minute). Use aggregate to get either the average (avg) or maximum (max) over that window over the time range.

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