简体   繁体   English

Amazon S3 自定义指标报告

[英]Amazon S3 custom metrics report

I have a requirement where large number of data package files (example:- xml,json,jpeg files) will be send to Amazon S3.我需要将大量数据包文件(例如:- xml、json、jpeg 文件)发送到 Amazon S3。 How can we get the aggregate count of data transmitted based on some input data points(for example- timestamp).我们如何获得基于某些输入数据点(例如时间戳)传输的数据的聚合计数。 Also how can I also get the information of the read/write time taken by Amazon S3.另外我怎样才能获得 Amazon S3 所用读/写时间的信息。 I have heard about Amazon Cloudwatch for custom metrics but I have no idea how to implement this use case using Amazon Cloudwatch.我听说过用于自定义指标的 Amazon Cloudwatch,但我不知道如何使用 Amazon Cloudwatch 实施此用例。

Basic approach is described in documentation . 文档中描述了基本方法。 Two default metric exists in every bucket, first to get files count and second to get files size.每个存储桶中都存在两个默认指标,第一个是获取文件数,第二个是获取文件大小。 How to get size of files is in doc and to get count of objects in bucket with name: 'ExampleBucket' use aws cli with this command:如何获取文件的大小在 doc 中并获取名称为“ExampleBucket”的存储桶中对象的数量:'ExampleBucket' 使用 aws cli 和以下命令:

aws cloudwatch get-metric-statistics --metric-name NumberOfObjects \
  --namespace AWS/S3 --start-time 2020-10-19T00:00:00Z \
  --end-time 2020-10-20T00:00:00Z --statistics Maximum --unit Count \
  --region us-west-1 \
  --dimensions Name=BucketName,Value=ExampleBucket Name=StorageType,Value=AllStorageTypes \
  --period 86400 --output json

For more code examples see this question .有关更多代码示例,请参阅此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM