Amazon CodeGuru Profiler

2019/12/03 - Amazon CodeGuru Profiler - 9 new api methods

Changes  (New Service) Amazon CodeGuru Profiler analyzes application CPU utilization and latency characteristics to show you where you are spending the most cycles in your application. This analysis is presented in an interactive flame graph that helps you easily understand which paths consume the most resources, verify that your application is performing as expected, and uncover areas that can be optimized further.

ListProfileTimes (new) Link ¶

List the start times of the available aggregated profiles of a profiling group for an aggregation period within the specified time range.

See also: AWS API Documentation

Request Syntax

client.list_profile_times(
    endTime=datetime(2015, 1, 1),
    maxResults=123,
    nextToken='string',
    orderBy='TimestampAscending'|'TimestampDescending',
    period='P1D'|'PT1H'|'PT5M',
    profilingGroupName='string',
    startTime=datetime(2015, 1, 1)
)
type endTime

datetime

param endTime

[REQUIRED]

The end time of the time range to list profiles until.

type maxResults

integer

param maxResults

Upper bound on the number of results to list in a single call.

type nextToken

string

param nextToken

Token for paginating results.

type orderBy

string

param orderBy

The order (ascending or descending by start time of the profile) to list the profiles by. Defaults to TIMESTAMP_DESCENDING.

type period

string

param period

[REQUIRED]

The aggregation period to list the profiles for.

type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

type startTime

datetime

param startTime

[REQUIRED]

The start time of the time range to list the profiles from.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'profileTimes': [
        {
            'start': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    Response for ListProfileTimes operation.

    • nextToken (string) --

      Token for paginating results.

    • profileTimes (list) --

      List of start times of the available profiles for the aggregation period in the specified time range.

      • (dict) --

        Periods of time used for aggregation of profiles, represented using ISO 8601 format.

        • start (datetime) --

          The start time of the profile.

GetProfile (new) Link ¶

Get the aggregated profile of a profiling group for the specified time range. If the requested time range does not align with the available aggregated profiles, it will be expanded to attain alignment. If aggregated profiles are available only for part of the period requested, the profile is returned from the earliest available to the latest within the requested time range. For instance, if the requested time range is from 00:00 to 00:20 and the available profiles are from 00:15 to 00:25, then the returned profile will be from 00:15 to 00:20.

See also: AWS API Documentation

Request Syntax

client.get_profile(
    accept='string',
    endTime=datetime(2015, 1, 1),
    maxDepth=123,
    period='string',
    profilingGroupName='string',
    startTime=datetime(2015, 1, 1)
)
type accept

string

param accept

The format of the profile to return. Supports application/json or application/x-amzn-ion. Defaults to application/x-amzn-ion.

type endTime

datetime

param endTime

The end time of the profile to get. Either period or endTime must be specified. Must be greater than start and the overall time range to be in the past and not larger than a week.

type maxDepth

integer

param maxDepth

Limit the max depth of the profile.

type period

string

param period

The period of the profile to get. Exactly two of startTime , period and endTime must be specified. Must be positive and the overall time range to be in the past and not larger than a week.

type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

type startTime

datetime

param startTime

The start time of the profile to get.

rtype

dict

returns

Response Syntax

{
    'contentEncoding': 'string',
    'contentType': 'string',
    'profile': StreamingBody()
}

Response Structure

  • (dict) --

    Response for GetProfile operation.

    • contentEncoding (string) --

      The content encoding of the profile in the payload.

    • contentType (string) --

      The content type of the profile in the payload. Will be application/json or application/x-amzn-ion based on Accept header in the request.

    • profile (:class:`.StreamingBody`) --

      The profile representing the aggregation of agent profiles of the profiling group for a time range.

PostAgentProfile (new) Link ¶

Submit profile collected by an agent belonging to a profiling group for aggregation.

See also: AWS API Documentation

Request Syntax

client.post_agent_profile(
    agentProfile=b'bytes'|file,
    contentType='string',
    profileToken='string',
    profilingGroupName='string'
)
type agentProfile

bytes or seekable file-like object

param agentProfile

[REQUIRED]

The profile collected by an agent for a time range.

type contentType

string

param contentType

[REQUIRED]

The content type of the agent profile in the payload. Recommended to send the profile gzipped with content-type application/octet-stream. Other accepted values are application/x-amzn-ion and application/json for unzipped Ion and JSON respectively.

type profileToken

string

param profileToken

Client generated token to deduplicate the agent profile during aggregation.

This field is autopopulated if not provided.

type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    Response for PostAgentProfile operation.

DeleteProfilingGroup (new) Link ¶

Delete a profiling group.

See also: AWS API Documentation

Request Syntax

client.delete_profiling_group(
    profilingGroupName='string'
)
type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    Response for DeleteProfilingGroup operation.

ListProfilingGroups (new) Link ¶

List profiling groups in the account.

See also: AWS API Documentation

Request Syntax

client.list_profiling_groups(
    includeDescription=True|False,
    maxResults=123,
    nextToken='string'
)
type includeDescription

boolean

param includeDescription

If set to true, returns the full description of the profiling groups instead of the names. Defaults to false.

type maxResults

integer

param maxResults

Upper bound on the number of results to list in a single call.

type nextToken

string

param nextToken

Token for paginating results.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'profilingGroupNames': [
        'string',
    ],
    'profilingGroups': [
        {
            'agentOrchestrationConfig': {
                'profilingEnabled': True|False
            },
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'name': 'string',
            'profilingStatus': {
                'latestAgentOrchestratedAt': datetime(2015, 1, 1),
                'latestAgentProfileReportedAt': datetime(2015, 1, 1),
                'latestAggregatedProfile': {
                    'period': 'P1D'|'PT1H'|'PT5M',
                    'start': datetime(2015, 1, 1)
                }
            },
            'updatedAt': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    Response for ListProfilingGroups operation.

    • nextToken (string) --

      Token for paginating results.

    • profilingGroupNames (list) --

      List of profiling group names.

      • (string) --

        The name of the profiling group.

    • profilingGroups (list) --

      List of profiling group descriptions.

      • (dict) --

        The description of a profiling group.

        • agentOrchestrationConfig (dict) --

          Configuration to orchestrate agents to create and report agent profiles of the profiling group. Agents are orchestrated if they follow the agent orchestration protocol.

          • profilingEnabled (boolean) --

            If the agents should be enabled to create and report profiles.

        • arn (string) --

          The ARN of the profiling group.

        • createdAt (datetime) --

          The timestamp of when the profiling group was created.

        • name (string) --

          The name of the profiling group.

        • profilingStatus (dict) --

          The status of profiling of a profiling group.

          • latestAgentOrchestratedAt (datetime) --

            Timestamp of when the last interaction of the agent with configureAgent API for orchestration.

          • latestAgentProfileReportedAt (datetime) --

            Timestamp of when the latest agent profile was successfully reported.

          • latestAggregatedProfile (dict) --

            The time range of latest aggregated profile available.

            • period (string) --

              The aggregation period of the aggregated profile.

            • start (datetime) --

              The start time of the aggregated profile.

        • updatedAt (datetime) --

          The timestamp of when the profiling group was last updated.

ConfigureAgent (new) Link ¶

Provides the configuration to use for an agent of the profiling group.

See also: AWS API Documentation

Request Syntax

client.configure_agent(
    fleetInstanceId='string',
    profilingGroupName='string'
)
type fleetInstanceId

string

param fleetInstanceId

Identifier of the instance of compute fleet being profiled by the agent. For instance, host name in EC2, task id for ECS, function name for AWS Lambda

type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

rtype

dict

returns

Response Syntax

{
    'configuration': {
        'periodInSeconds': 123,
        'shouldProfile': True|False
    }
}

Response Structure

  • (dict) --

    Response for ConfigureAgent operation.

    • configuration (dict) --

      The configuration for the agent to use.

      • periodInSeconds (integer) --

        Specifies the period to follow the configuration (to profile or not) and call back to get a new configuration.

      • shouldProfile (boolean) --

        Specifies if the profiling should be enabled by the agent.

DescribeProfilingGroup (new) Link ¶

Describe a profiling group.

See also: AWS API Documentation

Request Syntax

client.describe_profiling_group(
    profilingGroupName='string'
)
type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

rtype

dict

returns

Response Syntax

{
    'profilingGroup': {
        'agentOrchestrationConfig': {
            'profilingEnabled': True|False
        },
        'arn': 'string',
        'createdAt': datetime(2015, 1, 1),
        'name': 'string',
        'profilingStatus': {
            'latestAgentOrchestratedAt': datetime(2015, 1, 1),
            'latestAgentProfileReportedAt': datetime(2015, 1, 1),
            'latestAggregatedProfile': {
                'period': 'P1D'|'PT1H'|'PT5M',
                'start': datetime(2015, 1, 1)
            }
        },
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Response for DescribeProfilingGroup operation.

    • profilingGroup (dict) --

      The description of a profiling group.

      • agentOrchestrationConfig (dict) --

        Configuration to orchestrate agents to create and report agent profiles of the profiling group. Agents are orchestrated if they follow the agent orchestration protocol.

        • profilingEnabled (boolean) --

          If the agents should be enabled to create and report profiles.

      • arn (string) --

        The ARN of the profiling group.

      • createdAt (datetime) --

        The timestamp of when the profiling group was created.

      • name (string) --

        The name of the profiling group.

      • profilingStatus (dict) --

        The status of profiling of a profiling group.

        • latestAgentOrchestratedAt (datetime) --

          Timestamp of when the last interaction of the agent with configureAgent API for orchestration.

        • latestAgentProfileReportedAt (datetime) --

          Timestamp of when the latest agent profile was successfully reported.

        • latestAggregatedProfile (dict) --

          The time range of latest aggregated profile available.

          • period (string) --

            The aggregation period of the aggregated profile.

          • start (datetime) --

            The start time of the aggregated profile.

      • updatedAt (datetime) --

        The timestamp of when the profiling group was last updated.

UpdateProfilingGroup (new) Link ¶

Update a profiling group.

See also: AWS API Documentation

Request Syntax

client.update_profiling_group(
    agentOrchestrationConfig={
        'profilingEnabled': True|False
    },
    profilingGroupName='string'
)
type agentOrchestrationConfig

dict

param agentOrchestrationConfig

[REQUIRED]

Remote configuration to configure the agents of the profiling group.

  • profilingEnabled (boolean) -- [REQUIRED]

    If the agents should be enabled to create and report profiles.

type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

rtype

dict

returns

Response Syntax

{
    'profilingGroup': {
        'agentOrchestrationConfig': {
            'profilingEnabled': True|False
        },
        'arn': 'string',
        'createdAt': datetime(2015, 1, 1),
        'name': 'string',
        'profilingStatus': {
            'latestAgentOrchestratedAt': datetime(2015, 1, 1),
            'latestAgentProfileReportedAt': datetime(2015, 1, 1),
            'latestAggregatedProfile': {
                'period': 'P1D'|'PT1H'|'PT5M',
                'start': datetime(2015, 1, 1)
            }
        },
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Response for UpdateProfilingGroup operation.

    • profilingGroup (dict) --

      The description of a profiling group.

      • agentOrchestrationConfig (dict) --

        Configuration to orchestrate agents to create and report agent profiles of the profiling group. Agents are orchestrated if they follow the agent orchestration protocol.

        • profilingEnabled (boolean) --

          If the agents should be enabled to create and report profiles.

      • arn (string) --

        The ARN of the profiling group.

      • createdAt (datetime) --

        The timestamp of when the profiling group was created.

      • name (string) --

        The name of the profiling group.

      • profilingStatus (dict) --

        The status of profiling of a profiling group.

        • latestAgentOrchestratedAt (datetime) --

          Timestamp of when the last interaction of the agent with configureAgent API for orchestration.

        • latestAgentProfileReportedAt (datetime) --

          Timestamp of when the latest agent profile was successfully reported.

        • latestAggregatedProfile (dict) --

          The time range of latest aggregated profile available.

          • period (string) --

            The aggregation period of the aggregated profile.

          • start (datetime) --

            The start time of the aggregated profile.

      • updatedAt (datetime) --

        The timestamp of when the profiling group was last updated.

CreateProfilingGroup (new) Link ¶

Create a profiling group.

See also: AWS API Documentation

Request Syntax

client.create_profiling_group(
    agentOrchestrationConfig={
        'profilingEnabled': True|False
    },
    clientToken='string',
    profilingGroupName='string'
)
type agentOrchestrationConfig

dict

param agentOrchestrationConfig

Configuration to orchestrate agents to create and report agent profiles of the profiling group. Agents are orchestrated if they follow the agent orchestration protocol.

  • profilingEnabled (boolean) -- [REQUIRED]

    If the agents should be enabled to create and report profiles.

type clientToken

string

param clientToken

[REQUIRED]

Client token for the request.

This field is autopopulated if not provided.

type profilingGroupName

string

param profilingGroupName

[REQUIRED]

The name of the profiling group.

rtype

dict

returns

Response Syntax

{
    'profilingGroup': {
        'agentOrchestrationConfig': {
            'profilingEnabled': True|False
        },
        'arn': 'string',
        'createdAt': datetime(2015, 1, 1),
        'name': 'string',
        'profilingStatus': {
            'latestAgentOrchestratedAt': datetime(2015, 1, 1),
            'latestAgentProfileReportedAt': datetime(2015, 1, 1),
            'latestAggregatedProfile': {
                'period': 'P1D'|'PT1H'|'PT5M',
                'start': datetime(2015, 1, 1)
            }
        },
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Response for CreateProfilingGroup operation.

    • profilingGroup (dict) --

      The description of a profiling group.

      • agentOrchestrationConfig (dict) --

        Configuration to orchestrate agents to create and report agent profiles of the profiling group. Agents are orchestrated if they follow the agent orchestration protocol.

        • profilingEnabled (boolean) --

          If the agents should be enabled to create and report profiles.

      • arn (string) --

        The ARN of the profiling group.

      • createdAt (datetime) --

        The timestamp of when the profiling group was created.

      • name (string) --

        The name of the profiling group.

      • profilingStatus (dict) --

        The status of profiling of a profiling group.

        • latestAgentOrchestratedAt (datetime) --

          Timestamp of when the last interaction of the agent with configureAgent API for orchestration.

        • latestAgentProfileReportedAt (datetime) --

          Timestamp of when the latest agent profile was successfully reported.

        • latestAggregatedProfile (dict) --

          The time range of latest aggregated profile available.

          • period (string) --

            The aggregation period of the aggregated profile.

          • start (datetime) --

            The start time of the aggregated profile.

      • updatedAt (datetime) --

        The timestamp of when the profiling group was last updated.