getTimeSeriesServiceStatistics method
Get an aggregation of service statistics defined by a specific time range.
May throw InvalidRequestException. May throw ThrottledException.
Parameter endTime
:
The end of the time frame for which to aggregate statistics.
Parameter startTime
:
The start of the time frame for which to aggregate statistics.
Parameter entitySelectorExpression
:
A filter expression defining entities that will be aggregated for
statistics. Supports ID, service, and edge functions. If no selector
expression is specified, edge statistics are returned.
Parameter forecastStatistics
:
The forecasted high and low fault count values. Forecast enabled requests
require the EntitySelectorExpression ID be provided.
Parameter groupARN
:
The Amazon Resource Name (ARN) of the group for which to pull statistics
from.
Parameter groupName
:
The case-sensitive name of the group for which to pull statistics from.
Parameter nextToken
:
Pagination token.
Parameter period
:
Aggregation period in seconds.
Implementation
Future<GetTimeSeriesServiceStatisticsResult> getTimeSeriesServiceStatistics({
required DateTime endTime,
required DateTime startTime,
String? entitySelectorExpression,
bool? forecastStatistics,
String? groupARN,
String? groupName,
String? nextToken,
int? period,
}) async {
ArgumentError.checkNotNull(endTime, 'endTime');
ArgumentError.checkNotNull(startTime, 'startTime');
_s.validateStringLength(
'entitySelectorExpression',
entitySelectorExpression,
1,
500,
);
_s.validateStringLength(
'groupARN',
groupARN,
1,
400,
);
_s.validateStringLength(
'groupName',
groupName,
1,
32,
);
final $payload = <String, dynamic>{
'EndTime': unixTimestampToJson(endTime),
'StartTime': unixTimestampToJson(startTime),
if (entitySelectorExpression != null)
'EntitySelectorExpression': entitySelectorExpression,
if (forecastStatistics != null) 'ForecastStatistics': forecastStatistics,
if (groupARN != null) 'GroupARN': groupARN,
if (groupName != null) 'GroupName': groupName,
if (nextToken != null) 'NextToken': nextToken,
if (period != null) 'Period': period,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/TimeSeriesServiceStatistics',
exceptionFnMap: _exceptionFns,
);
return GetTimeSeriesServiceStatisticsResult.fromJson(response);
}