Dynamodb 简明教程

DynamoDB - Monitoring

Amazon 通过 CloudWatch 控制台、命令行或 CloudWatch API 提供 CloudWatch,以聚合并分析性能。您还可以使用它设置警报并执行任务。它对某些事件执行特定的操作。

Amazon offers CloudWatch for aggregating and analyzing performance through the CloudWatch console, command line, or CloudWatch API. You can also use it to set alarms and perform tasks. It performs specified actions on certain events.

Cloudwatch Console

通过访问管理控制台,然后在 https://console.aws.amazon.com/cloudwatch/ 打开 CloudWatch 控制台,利用 CloudWatch。

Utilize CloudWatch by accessing the Management Console, and then opening the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

然后,您可以执行以下步骤 −

You can then perform the following steps −

  1. Select Metrics from the navigation pane.

  2. Under DynamoDB metrics within the CloudWatch Metrics by Category pane, choose Table Metrics.

  3. Use the upper pane to scroll below and examine the entire list of table metrics. The Viewing list provides metrics options.

在结果界面中,您可以通过选择资源名称和指标旁边的复选框来选择/取消选择每个指标。然后,您将能够查看每个项目的图表。

In the results interface, you can select/deselect each metric by selecting the checkbox beside the resource name and metric. Then you would be able to view graphs for each item.

API Integration

您可以使用查询访问 CloudWatch。使用指标值执行 CloudWatch 操作。注意 DynamoDB 不会发送值为零的指标。它只是跳过这些指标在该值期间内保持的时间段。

You can access CloudWatch with queries. Use metric values to perform CloudWatch actions. Note DynamoDB does not send metrics with a value of zero. It simply skips metrics for time periods where those metrics remain at that value.

以下是其中一些最常用的指标 −

The following are some of the most commonly used metrics −

  1. ConditionalCheckFailedRequests − It tracks the quantity of failed attempts at conditional writes such as conditional PutItem writes. The failed writes increment this metric by one on evaluation to false. It also throws an HTTP 400 error.

  2. ConsumedReadCapacityUnits − It quantifies the capacity units used over a certain time period. You can use this to examine individual table and index consumption.

  3. ConsumedWriteCapacityUnits − It quantifies the capacity units used over a certain time period. You can use this to examine individual table and index consumption.

  4. ReadThrottleEvents − It quantifies requests exceeding provisioned capacity units in table/index reads. It increments on each throttle including batch operations with multiple throttles.

  5. ReturnedBytes − It quantifies the bytes returned in retrieval operations within a certain time period.

  6. ReturnedItemCount − It quantifies the items returned in Query and Scan operations over a certain time period. It addresses only items returned, not those evaluated, which are typically totally different figures.

Note - 存在更多指标,大多数指标允许您计算平均值、和、最大值、最小值和计数。

Note − There are many more metrics that exist, and most of these allow you to calculate averages, sums, maximum, minimum, and count.