get_percentiles

get_percentiles(**kwargs)

Groups the aggregated values that match the query into percentile groupings. The default percentile groupings are: 1,5,25,50,75,95,99, although you can specify your own when you call GetPercentiles . This function returns a value for each percentile group specified (or the default percentile groupings). The percentile group "1" contains the aggregated field value that occurs in approximately one percent of the values that match the query. The percentile group "5" contains the aggregated field value that occurs in approximately five percent of the values that match the query, and so on. The result is an approximation, the more values that match the query, the more accurate the percentile values.

Requires permission to access the GetPercentiles action.

See also: AWS API Documentation

Request Syntax

response = client.get_percentiles(
    indexName='string',
    queryString='string',
    aggregationField='string',
    queryVersion='string',
    percents=[
        123.0,
    ]
)
Parameters
  • indexName (string) -- The name of the index to search.
  • queryString (string) --

    [REQUIRED]

    The search query string.

  • aggregationField (string) -- The field to aggregate.
  • queryVersion (string) -- The query version.
  • percents (list) --

    The percentile groups returned.

    • (float) --
Return type

dict

Returns

Response Syntax

{
    'percentiles': [
        {
            'percent': 123.0,
            'value': 123.0
        },
    ]
}

Response Structure

  • (dict) --

    • percentiles (list) --

      The percentile values of the aggregated fields.

      • (dict) --

        Describes the percentile and percentile value.

        • percent (float) --

          The percentile.

        • value (float) --

          The value of the percentile.

Exceptions

  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.ThrottlingException
  • IoT.Client.exceptions.UnauthorizedException
  • IoT.Client.exceptions.ServiceUnavailableException
  • IoT.Client.exceptions.InternalFailureException
  • IoT.Client.exceptions.ResourceNotFoundException
  • IoT.Client.exceptions.InvalidQueryException
  • IoT.Client.exceptions.InvalidAggregationException
  • IoT.Client.exceptions.IndexNotReadyException