简体   繁体   English

如何从Amazon Cloudwatch获取冰川存储指标?

[英]How can I get glacier storage metrics from Amazon Cloudwatch?

I've got a series of s3 buckets with content split between Glacier and Infrequent access storage. 我有一系列s3存储桶,内容在Glacier和不频繁访问存储之间分配。 I'd like to use cloudwatch via the PHP SDK to monitor the amount of data in different types of storage. 我想通过PHP SDK使用cloudwatch来监视不同类型的存储中的数据量。

I can monitor the amount Infrequent Access storage using: 我可以使用以下方法监视不频繁访问存储的数量:

$cloudwatch->getMetricStatistics(
        array(
            'Namespace' => 'AWS/S3',
            'MetricName' => 'BucketSizeBytes',
            'StartTime' => $start,
            'EndTime' => $end,
            'Period' => 86400,
            'Unit' => 'Gigabytes',
            'Statistics' => array('Average'),
            'Dimensions' => array(
                array(
                    'Name' => 'BucketName',
                    'Value' => $BucketName
                ),
                array(
                    'Name' => 'StorageType',
                    'Value' => 'StandardIAStorage'
                )
            )
        )
    );

Where $cloudwatch is an aws cloudwatch client $cloudwatchAWS CloudWatch客户端的地方

From what I've read the documentation , I can't see a clear way of measuring the amount of data in glacier storage. 从我阅读的文档中 ,我看不到一种清晰的方法来测量冰川存储中的数据量。

Has anyone found a way of doing this? 有没有人找到这样做的方法? Ideally, explicitly from cloudwatch but if not implicitly from the figures that are available. 理想情况下,从cloudwatch显式显示,但如果不是,则从可用数字中隐式显示。

Yes, you can turn on Amazon S3 Storage Inventory and configure it for your bucket. 是的,您可以打开Amazon S3存储库存并为您的存储桶配置它。

This will store a daily inventory file in Amazon S3 that includes filesize and storage class. 这会将每日库存文件存储在Amazon S3中,其中包括文件大小和存储类别。 Here's a sample from one of my buckets: 这是我的一个存储桶中的一个示例:

"my-bucket","Cat-Teacup+kitten.jpg","15091","GLACIER"
"my-bucket","Cheese-Challerhocker.jpg","40147","GLACIER"
"my-bucket","Cheese-Grevenbroeker.jpg","29228","GLACIER"
"my-bucket","Cheese-Leyden.jpg","83056","GLACIER"

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

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