IoT / Client / get_statistics

get_statistics#

IoT.Client.get_statistics(**kwargs)#

Returns the count, average, sum, minimum, maximum, sum of squares, variance, and standard deviation for the specified aggregated field. If the aggregation field is of type String, only the count statistic is returned.

Requires permission to access the GetStatistics action.

See also: AWS API Documentation

Request Syntax

response = client.get_statistics(
    indexName='string',
    queryString='string',
    aggregationField='string',
    queryVersion='string'
)
Parameters:
  • indexName (string) – The name of the index to search. The default value is AWS_Things.

  • queryString (string) –

    [REQUIRED]

    The query used to search. You can specify “*” for the query string to get the count of all indexed things in your Amazon Web Services account.

  • aggregationField (string) – The aggregation field name.

  • queryVersion (string) – The version of the query used to search.

Return type:

dict

Returns:

Response Syntax

{
    'statistics': {
        'count': 123,
        'average': 123.0,
        'sum': 123.0,
        'minimum': 123.0,
        'maximum': 123.0,
        'sumOfSquares': 123.0,
        'variance': 123.0,
        'stdDeviation': 123.0
    }
}

Response Structure

  • (dict) –

    • statistics (dict) –

      The statistics returned by the Fleet Indexing service based on the query and aggregation field.

      • count (integer) –

        The count of things that match the query string criteria and contain a valid aggregation field value.

      • average (float) –

        The average of the aggregated field values.

      • sum (float) –

        The sum of the aggregated field values.

      • minimum (float) –

        The minimum aggregated field value.

      • maximum (float) –

        The maximum aggregated field value.

      • sumOfSquares (float) –

        The sum of the squares of the aggregated field values.

      • variance (float) –

        The variance of the aggregated field values.

      • stdDeviation (float) –

        The standard deviation of the aggregated field values.

Exceptions