我GetMetricsData
从 AWS CloudWatch 查询:
{
StartTime: lastWeek ,
EndTime: today,
MetricDataQueries: [
{
Id: 'invocations',
Label: 'Invocations',
MetricStat: {
Metric: {
Dimensions: [
{
Name: 'FunctionName',
Value: /* FunctionName */,
},
],
MetricName: 'Invocations',
Namespace: 'AWS/Lambda'
},
Period: 60*60*24, // day
Stat: 'Sum',
Unit: 'Count',
},
},
],
}
这就是我得到的:
我没有得到 7 天(即一周)的数据,而是得到 5 天。我有 2 天失踪(如图所示)。
那些失踪的日子没有任何数据。
CloudWatch 不会返回没有数据的点。如何使Sum
操作返回实际计数(0
)?