listMetrics method
- List<
DimensionFilter> ? dimensions, - String? metricName,
- String? namespace,
- String? nextToken,
- RecentlyActive? recentlyActive,
List the specified metrics. You can use the returned metrics with GetMetricData or GetMetricStatistics to obtain statistical data.
Up to 500 results are returned for any one call. To retrieve additional results, use the returned token with subsequent calls.
After you create a metric, allow up to 15 minutes before the metric appears. You can see statistics about the metric sooner by using GetMetricData or GetMetricStatistics.
ListMetrics
doesn't return information about metrics if those
metrics haven't reported data in the past two weeks. To retrieve those
metrics, use GetMetricData
or GetMetricStatistics.
May throw InternalServiceFault. May throw InvalidParameterValueException.
Parameter dimensions
:
The dimensions to filter against. Only the dimensions that match exactly
will be returned.
Parameter metricName
:
The name of the metric to filter against. Only the metrics with names that
match exactly will be returned.
Parameter namespace
:
The metric namespace to filter against. Only the namespace that matches
exactly will be returned.
Parameter nextToken
:
The token returned by a previous call to indicate that there is more data
available.
Parameter recentlyActive
:
To filter the results to show only metrics that have had data points
published in the past three hours, specify this parameter with a value of
PT3H
. This is the only valid value for this parameter.
The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 40 minutes more than the specified time interval.
Implementation
Future<ListMetricsOutput> listMetrics({
List<DimensionFilter>? dimensions,
String? metricName,
String? namespace,
String? nextToken,
RecentlyActive? recentlyActive,
}) async {
_s.validateStringLength(
'metricName',
metricName,
1,
255,
);
_s.validateStringLength(
'namespace',
namespace,
1,
255,
);
final $request = <String, dynamic>{};
dimensions?.also((arg) => $request['Dimensions'] = arg);
metricName?.also((arg) => $request['MetricName'] = arg);
namespace?.also((arg) => $request['Namespace'] = arg);
nextToken?.also((arg) => $request['NextToken'] = arg);
recentlyActive?.also((arg) => $request['RecentlyActive'] = arg.toValue());
final $result = await _protocol.send(
$request,
action: 'ListMetrics',
version: '2010-08-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ListMetricsInput'],
shapes: shapes,
resultWrapper: 'ListMetricsResult',
);
return ListMetricsOutput.fromXml($result);
}