getFunctionsMetrics method
Is the org's serverless dashboard over a window: a per-function invocation costLine and how those invocations ended.
Is the org's serverless dashboard over a window: a per-function invocation costLine and how those invocations ended. Every point is a REAL count of rows that fell in that bucket — nothing is interpolated or invented, so an empty window draws a flat line rather than a fabricated one. costCents is null and stays null: there is no per-invocation cost source to read, and reporting a number computed some other way would be a guess presented as a measurement. Requires a validated principal; the read is scoped to its org.
Parameters:
- String range: Range is 1H, 6H, 24H (the default), 7D or 30D. Anything else falls back to 24H rather than failing.
Implementation
Future<Usage?> getFunctionsMetrics({ String? range, }) async {
final response = await getFunctionsMetricsWithHttpInfo( range: range, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Usage',) as Usage;
}
return null;
}