com.amazonaws.services.cloudwatch.model.GetMetricStatisticsRequest.setPeriod()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(75)

本文整理了Java中com.amazonaws.services.cloudwatch.model.GetMetricStatisticsRequest.setPeriod()方法的一些代码示例,展示了GetMetricStatisticsRequest.setPeriod()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GetMetricStatisticsRequest.setPeriod()方法的具体详情如下:
包路径:com.amazonaws.services.cloudwatch.model.GetMetricStatisticsRequest
类名称:GetMetricStatisticsRequest
方法名:setPeriod

GetMetricStatisticsRequest.setPeriod介绍

[英]The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second.

If the StartTime parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:

  • Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
  • Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
  • Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
    [中]返回的数据点的粒度(以秒为单位)。对于具有常规分辨率的度量,周期可以短至一分钟(60秒),并且必须是60的倍数。对于以少于一分钟的间隔收集的高分辨率度量,周期可以是1、5、10、30、60或60的任意倍数。高分辨率指标是由PutMetricData调用存储的指标,该调用包括1秒的StorageResolution
    如果StartTime参数指定的时间戳大于3小时前,则必须按以下方式指定时间段,否则将不返回该时间范围内的数据点:
    *开始时间在3小时到15天前-使用60秒(1分钟)的倍数。
    *开始时间在15到63天前-使用300秒(5分钟)的倍数。
    *开始时间大于63天前-使用3600秒(1小时)的倍数。

代码示例

代码示例来源:origin: aws/aws-sdk-java

setPeriod(period);
return this;

代码示例来源:origin: petezybrick/awscwxls

GetMetricStatisticsRequest getMetricRequest = new GetMetricStatisticsRequest();
getMetricRequest.setNamespace( extractItem.getNamespace() );
getMetricRequest.setPeriod( extractItem.getPeriodMinutes() * 60 );

代码示例来源:origin: prometheus/cloudwatch_exporter

request.setEndTime(startDate);
request.setStartTime(endDate);
request.setPeriod(rule.periodSeconds);

相关文章

微信公众号

最新文章

更多