get_relational_database_metric_data
¶
get_relational_database_metric_data(
relational_database_name: ResourceName,
metric_name: RelationalDatabaseMetricName,
period: MetricPeriod,
start_time: IsoDate,
end_time: IsoDate,
unit: MetricUnit,
statistics: MetricStatisticList,
*,
config_overrides: Optional[LightsailClientConfig] = None,
) -> GetRelationalDatabaseMetricDataResult
Returns the data points of the specified metric for a database in Amazon Lightsail.
Metrics report the utilization of your resources, and the error counts generated by them. Monitor and collect metric data regularly to maintain the reliability, availability, and performance of your resources.
Parameters:
-
relational_database_name(ResourceName) –The name of your database from which to get metric data.
-
metric_name(RelationalDatabaseMetricName) –The metric for which you want to return information.
Valid relational database metric names are listed below, along with the most useful
statisticsto include in your request, and the publishedunitvalue. All relational database metric data is available in 1-minute (60 seconds) granularity.-
CPUUtilization- The percentage of CPU utilization currently in use on the database.Statistics: The most useful statistics areMaximumandAverage.Unit: The published unit isPercent. -
DatabaseConnections- The number of database connections in use.Statistics: The most useful statistics areMaximumandSum.Unit: The published unit isCount. -
DiskQueueDepth- The number of outstanding IOs (read/write requests) that are waiting to access the disk.Statistics: The most useful statistic isSum.Unit: The published unit isCount. -
FreeStorageSpace- The amount of available storage space.Statistics: The most useful statistic isSum.Unit: The published unit isBytes. -
NetworkReceiveThroughput- The incoming (Receive) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.Statistics: The most useful statistic isAverage.Unit: The published unit isBytes/Second. -
NetworkTransmitThroughput- The outgoing (Transmit) network traffic on the database, including both customer database traffic and AWS traffic used for monitoring and replication.Statistics: The most useful statistic isAverage.Unit: The published unit isBytes/Second.
-
-
period(MetricPeriod) –The granularity, in seconds, of the returned data points.
All relational database metric data is available in 1-minute (60 seconds) granularity.
-
start_time(IsoDate) –The start of the time interval from which to get metric data.
Constraints:
-
Specified in Coordinated Universal Time (UTC).
-
Specified in the Unix time format.
For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input
1538424000as the start time.
-
-
end_time(IsoDate) –The end of the time interval from which to get metric data.
Constraints:
-
Specified in Coordinated Universal Time (UTC).
-
Specified in the Unix time format.
For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input
1538424000as the end time.
-
-
unit(MetricUnit) –The unit for the metric data request. Valid units depend on the metric data being requested. For the valid units with each available metric, see the
metricNameparameter. -
statistics(MetricStatisticList) –The statistic for the metric.
The following statistics are available:
-
Minimum- The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application. -
Maximum- The highest value observed during the specified period. Use this value to determine high volumes of activity for your application. -
Sum- All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric. -
Average- The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources. -
SampleCount- The count, or number, of data points used for the statistical calculation.
-
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
AccountSetupInProgressException–Lightsail throws this exception when an account is still in the setup in progress state.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/lightsail.py
7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 | |