You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.PI

Inherits:
AWS.Service show all
Identifier:
pi
API Version:
2018-02-27
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Amazon RDS Performance Insights enables you to monitor and explore different dimensions of database load based on data captured from a running DB instance. The guide provides detailed information about Performance Insights data types, parameters and errors.

When Performance Insights is enabled, the Amazon RDS Performance Insights API provides visibility into the performance of your DB instance. Amazon CloudWatch provides the authoritative source for AWS service-vended monitoring metrics. Performance Insights offers a domain-specific view of DB load.

DB load is measured as Average Active Sessions. Performance Insights provides the data to API consumers as a two-dimensional time-series dataset. The time dimension provides DB load data for each time point in the queried time range. Each time point decomposes overall load in relation to the requested dimensions, measured at that time point. Examples include SQL, Wait event, User, and Host.

Sending a Request Using PI

var pi = new AWS.PI();
pi.describeDimensionKeys(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the PI object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var pi = new AWS.PI({apiVersion: '2018-02-27'});

You can also set the API version globally in AWS.config.apiVersions using the pi service identifier:

AWS.config.apiVersions = {
  pi: '2018-02-27',
  // other service API versions
};

var pi = new AWS.PI();

Version:

  • 2018-02-27

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.PI(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a PI object

var pi = new AWS.PI({apiVersion: '2018-02-27'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.PI.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.PI.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.PI.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

describeDimensionKeys(params = {}, callback) ⇒ AWS.Request

For a specific time period, retrieve the top N dimension keys for a metric.

Note: Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements, only the first 500 bytes are returned.

Service Reference:

Examples:

Calling the describeDimensionKeys operation

var params = {
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  GroupBy: { /* required */
    Group: 'STRING_VALUE', /* required */
    Dimensions: [
      'STRING_VALUE',
      /* more items */
    ],
    Limit: 'NUMBER_VALUE'
  },
  Identifier: 'STRING_VALUE', /* required */
  Metric: 'STRING_VALUE', /* required */
  ServiceType: RDS, /* required */
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  Filter: {
    '<RequestString>': 'STRING_VALUE',
    /* '<RequestString>': ... */
  },
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  PartitionBy: {
    Group: 'STRING_VALUE', /* required */
    Dimensions: [
      'STRING_VALUE',
      /* more items */
    ],
    Limit: 'NUMBER_VALUE'
  },
  PeriodInSeconds: 'NUMBER_VALUE'
};
pi.describeDimensionKeys(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ServiceType — (String)

      The AWS service for which Performance Insights will return metrics. The only valid value for ServiceType is RDS.

      Possible values include:
      • "RDS"
    • Identifier — (String)

      An immutable, AWS Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.

      To use an Amazon RDS instance as a data source, you specify its DbiResourceId value. For example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A

    • StartTime — (Date)

      The date and time specifying the beginning of the requested time series data. You must specify a StartTime within the past 7 days. The value specified is inclusive, which means that data points equal to or greater than StartTime are returned.

      The value for StartTime must be earlier than the value for EndTime.

    • EndTime — (Date)

      The date and time specifying the end of the requested time series data. The value specified is exclusive, which means that data points less than (but not equal to) EndTime are returned.

      The value for EndTime must be later than the value for StartTime.

    • Metric — (String)

      The name of a Performance Insights metric to be measured.

      Valid values for Metric are:

      • db.load.avg - a scaled representation of the number of active sessions for the database engine.

      • db.sampledload.avg - the raw number of active sessions for the database engine.

      If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and db.sampledload.avg are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the scaled values, db.sampledload.avg showing the raw values, and db.sampledload.avg less than db.load.avg. For most use cases, you can query db.load.avg only.

    • PeriodInSeconds — (Integer)

      The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:

      • 1 (one second)

      • 60 (one minute)

      • 300 (five minutes)

      • 3600 (one hour)

      • 86400 (twenty-four hours)

      If you don't specify PeriodInSeconds, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response.

    • GroupBy — (map)

      A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension.

      • Grouprequired — (String)

        The name of the dimension group. Valid values are:

        • db - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)

        • db.application - The name of the application that is connected to the database (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.host - The host name of the connected client (all engines)

        • db.session_type - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.sql - The SQL that is currently executing (all engines)

        • db.sql_tokenized - The SQL digest (all engines)

        • db.wait_event - The event for which the database backend is waiting (all engines)

        • db.wait_event_type - The type of event for which the database backend is waiting (all engines)

        • db.user - The user logged in to the database (all engines)

      • Dimensions — (Array<String>)

        A list of specific dimensions from a dimension group. If this parameter is not present, then it signifies that all of the dimensions in the group were requested, or are present in the response.

        Valid values for elements in the Dimensions array are:

        • db.application.name - The name of the application that is connected to the database (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.host.id - The host ID of the connected client (all engines)

        • db.host.name - The host name of the connected client (all engines)

        • db.name - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)

        • db.session_type.name - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.sql.id - The SQL ID generated by Performance Insights (all engines)

        • db.sql.db_id - The SQL ID generated by the database (all engines)

        • db.sql.statement - The SQL text that is being executed (all engines)

        • db.sql.tokenized_id

        • db.sql_tokenized.id - The SQL digest ID generated by Performance Insights (all engines)

        • db.sql_tokenized.db_id - SQL digest ID generated by the database (all engines)

        • db.sql_tokenized.statement - The SQL digest text (all engines)

        • db.user.id - The ID of the user logged in to the database (all engines)

        • db.user.name - The name of the user logged in to the database (all engines)

        • db.wait_event.name - The event for which the backend is waiting (all engines)

        • db.wait_event.type - The type of event for which the backend is waiting (all engines)

        • db.wait_event_type.name - The name of the event type for which the backend is waiting (all engines)

      • Limit — (Integer)

        The maximum number of items to fetch for this dimension group.

    • PartitionBy — (map)

      For each dimension specified in GroupBy, specify a secondary dimension to further subdivide the partition keys in the response.

      • Grouprequired — (String)

        The name of the dimension group. Valid values are:

        • db - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)

        • db.application - The name of the application that is connected to the database (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.host - The host name of the connected client (all engines)

        • db.session_type - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.sql - The SQL that is currently executing (all engines)

        • db.sql_tokenized - The SQL digest (all engines)

        • db.wait_event - The event for which the database backend is waiting (all engines)

        • db.wait_event_type - The type of event for which the database backend is waiting (all engines)

        • db.user - The user logged in to the database (all engines)

      • Dimensions — (Array<String>)

        A list of specific dimensions from a dimension group. If this parameter is not present, then it signifies that all of the dimensions in the group were requested, or are present in the response.

        Valid values for elements in the Dimensions array are:

        • db.application.name - The name of the application that is connected to the database (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.host.id - The host ID of the connected client (all engines)

        • db.host.name - The host name of the connected client (all engines)

        • db.name - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)

        • db.session_type.name - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)

        • db.sql.id - The SQL ID generated by Performance Insights (all engines)

        • db.sql.db_id - The SQL ID generated by the database (all engines)

        • db.sql.statement - The SQL text that is being executed (all engines)

        • db.sql.tokenized_id

        • db.sql_tokenized.id - The SQL digest ID generated by Performance Insights (all engines)

        • db.sql_tokenized.db_id - SQL digest ID generated by the database (all engines)

        • db.sql_tokenized.statement - The SQL digest text (all engines)

        • db.user.id - The ID of the user logged in to the database (all engines)

        • db.user.name - The name of the user logged in to the database (all engines)

        • db.wait_event.name - The event for which the backend is waiting (all engines)

        • db.wait_event.type - The type of event for which the backend is waiting (all engines)

        • db.wait_event_type.name - The name of the event type for which the backend is waiting (all engines)

      • Limit — (Integer)

        The maximum number of items to fetch for this dimension group.

    • Filter — (map<String>)

      One or more filters to apply in the request. Restrictions:

      • Any number of filters by the same dimension, as specified in the GroupBy or Partition parameters.

      • A single filter for any other dimension in this dimension group.

    • MaxResults — (Integer)

      The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.

    • NextToken — (String)

      An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AlignedStartTime — (Date)

        The start time for the returned dimension keys, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedStartTime will be less than or equal to the value of the user-specified StartTime.

      • AlignedEndTime — (Date)

        The end time for the returned dimension keys, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater than or equal to the value of the user-specified Endtime.

      • PartitionKeys — (Array<map>)

        If PartitionBy was present in the request, PartitionKeys contains the breakdown of dimension keys by the specified partitions.

        • Dimensionsrequired — (map<String>)

          A dimension map that contains the dimension(s) for this partition.

      • Keys — (Array<map>)

        The dimension keys that were requested.

        • Dimensions — (map<String>)

          A map of name-value pairs for the dimensions in the group.

        • Total — (Float)

          The aggregated metric value for the dimension(s), over the requested time range.

        • Partitions — (Array<Float>)

          If PartitionBy was specified, PartitionKeys contains the dimensions that were.

      • NextToken — (String)

        An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDimensionKeyDetails(params = {}, callback) ⇒ AWS.Request

Get the attributes of the specified dimension group for a DB instance or data source. For example, if you specify a SQL ID, GetDimensionKeyDetails retrieves the full text of the dimension db.sql.statement associated with this ID. This operation is useful because GetResourceMetrics and DescribeDimensionKeys don't support retrieval of large SQL statement text.

Service Reference:

Examples:

Calling the getDimensionKeyDetails operation

var params = {
  Group: 'STRING_VALUE', /* required */
  GroupIdentifier: 'STRING_VALUE', /* required */
  Identifier: 'STRING_VALUE', /* required */
  ServiceType: RDS, /* required */
  RequestedDimensions: [
    'STRING_VALUE',
    /* more items */
  ]
};
pi.getDimensionKeyDetails(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ServiceType — (String)

      The AWS service for which Performance Insights returns data. The only valid value is RDS.

      Possible values include:
      • "RDS"
    • Identifier — (String)

      The ID for a data source from which to gather dimension data. This ID must be immutable and unique within an AWS Region. When a DB instance is the data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.

    • Group — (String)

      The name of the dimension group. The only valid value is db.sql. Performance Insights searches the specified group for the dimension group ID.

    • GroupIdentifier — (String)

      The ID of the dimension group from which to retrieve dimension details. For dimension group db.sql, the group ID is db.sql.id.

    • RequestedDimensions — (Array<String>)

      A list of dimensions to retrieve the detail data for within the given dimension group. For the dimension group db.sql, specify either the full dimension name db.sql.statement or the short dimension name statement. If you don't specify this parameter, Performance Insights returns all dimension data within the specified dimension group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Dimensions — (Array<map>)

        The details for the requested dimensions.

        • Value — (String)

          The value of the dimension detail data. For the db.sql.statement dimension, this value is either the full or truncated SQL query, depending on the return status.

        • Dimension — (String)

          The full name of the dimension. The full name includes the group name and key name. The only valid value is db.sql.statement.

        • Status — (String)

          The status of the dimension detail data. Possible values include the following:

          • AVAILABLE - The dimension detail data is ready to be retrieved.

          • PROCESSING - The dimension detail data isn't ready to be retrieved because more processing time is required. If the requested detail data for db.sql.statement has the status PROCESSING, Performance Insights returns the truncated query.

          • UNAVAILABLE - The dimension detail data could not be collected successfully.

          Possible values include:
          • "AVAILABLE"
          • "PROCESSING"
          • "UNAVAILABLE"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getResourceMetrics(params = {}, callback) ⇒ AWS.Request

Retrieve Performance Insights metrics for a set of data sources, over a time period. You can provide specific dimension groups and dimensions, and provide aggregation and filtering criteria for each group.

Note: Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements, only the first 500 bytes are returned.

Service Reference:

Examples:

Calling the getResourceMetrics operation

var params = {
  EndTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  Identifier: 'STRING_VALUE', /* required */
  MetricQueries: [ /* required */
    {
      Metric: 'STRING_VALUE', /* required */
      Filter: {
        '<RequestString>': 'STRING_VALUE',
        /* '<RequestString>': ... */
      },
      GroupBy: {
        Group: 'STRING_VALUE', /* required */
        Dimensions: [
          'STRING_VALUE',
          /* more items */
        ],
        Limit: 'NUMBER_VALUE'
      }
    },
    /* more items */
  ],
  ServiceType: RDS, /* required */
  StartTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  PeriodInSeconds: 'NUMBER_VALUE'
};
pi.getResourceMetrics(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ServiceType — (String)

      The AWS service for which Performance Insights returns metrics. The only valid value for ServiceType is RDS.

      Possible values include:
      • "RDS"
    • Identifier — (String)

      An immutable, AWS Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.

      To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A.

    • MetricQueries — (Array<map>)

      An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.

      • Metricrequired — (String)

        The name of a Performance Insights metric to be measured.

        Valid values for Metric are:

        • db.load.avg - a scaled representation of the number of active sessions for the database engine.

        • db.sampledload.avg - the raw number of active sessions for the database engine.

        If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and db.sampledload.avg are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the scaled values, db.sampledload.avg showing the raw values, and db.sampledload.avg less than db.load.avg. For most use cases, you can query db.load.avg only.

      • GroupBy — (map)

        A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights will return all of the dimensions within that group, unless you provide the names of specific dimensions within that group. You can also request that Performance Insights return a limited number of values for a dimension.

        • Grouprequired — (String)

          The name of the dimension group. Valid values are:

          • db - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)

          • db.application - The name of the application that is connected to the database (only Aurora PostgreSQL and RDS PostgreSQL)

          • db.host - The host name of the connected client (all engines)

          • db.session_type - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)

          • db.sql - The SQL that is currently executing (all engines)

          • db.sql_tokenized - The SQL digest (all engines)

          • db.wait_event - The event for which the database backend is waiting (all engines)

          • db.wait_event_type - The type of event for which the database backend is waiting (all engines)

          • db.user - The user logged in to the database (all engines)

        • Dimensions — (Array<String>)

          A list of specific dimensions from a dimension group. If this parameter is not present, then it signifies that all of the dimensions in the group were requested, or are present in the response.

          Valid values for elements in the Dimensions array are:

          • db.application.name - The name of the application that is connected to the database (only Aurora PostgreSQL and RDS PostgreSQL)

          • db.host.id - The host ID of the connected client (all engines)

          • db.host.name - The host name of the connected client (all engines)

          • db.name - The name of the database to which the client is connected (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)

          • db.session_type.name - The type of the current session (only Aurora PostgreSQL and RDS PostgreSQL)

          • db.sql.id - The SQL ID generated by Performance Insights (all engines)

          • db.sql.db_id - The SQL ID generated by the database (all engines)

          • db.sql.statement - The SQL text that is being executed (all engines)

          • db.sql.tokenized_id

          • db.sql_tokenized.id - The SQL digest ID generated by Performance Insights (all engines)

          • db.sql_tokenized.db_id - SQL digest ID generated by the database (all engines)

          • db.sql_tokenized.statement - The SQL digest text (all engines)

          • db.user.id - The ID of the user logged in to the database (all engines)

          • db.user.name - The name of the user logged in to the database (all engines)

          • db.wait_event.name - The event for which the backend is waiting (all engines)

          • db.wait_event.type - The type of event for which the backend is waiting (all engines)

          • db.wait_event_type.name - The name of the event type for which the backend is waiting (all engines)

        • Limit — (Integer)

          The maximum number of items to fetch for this dimension group.

      • Filter — (map<String>)

        One or more filters to apply in the request. Restrictions:

        • Any number of filters by the same dimension, as specified in the GroupBy parameter.

        • A single filter for any other dimension in this dimension group.

    • StartTime — (Date)

      The date and time specifying the beginning of the requested time series data. You can't specify a StartTime that's earlier than 7 days ago. The value specified is inclusive - data points equal to or greater than StartTime will be returned.

      The value for StartTime must be earlier than the value for EndTime.

    • EndTime — (Date)

      The date and time specifying the end of the requested time series data. The value specified is exclusive - data points less than (but not equal to) EndTime will be returned.

      The value for EndTime must be later than the value for StartTime.

    • PeriodInSeconds — (Integer)

      The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:

      • 1 (one second)

      • 60 (one minute)

      • 300 (five minutes)

      • 3600 (one hour)

      • 86400 (twenty-four hours)

      If you don't specify PeriodInSeconds, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.

    • MaxResults — (Integer)

      The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.

    • NextToken — (String)

      An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AlignedStartTime — (Date)

        The start time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedStartTime will be less than or equal to the value of the user-specified StartTime.

      • AlignedEndTime — (Date)

        The end time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater than or equal to the value of the user-specified Endtime.

      • Identifier — (String)

        An immutable, AWS Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.

        To use a DB instance as a data source, you specify its DbiResourceId value - for example: db-FAIHNTYBKTGAUSUZQYPDS2GW4A

      • MetricList — (Array<map>)

        An array of metric results,, where each array element contains all of the data points for a particular dimension.

        • Key — (map)

          The dimension(s) to which the data points apply.

          • Metricrequired — (String)

            The name of a Performance Insights metric to be measured.

            Valid values for Metric are:

            • db.load.avg - a scaled representation of the number of active sessions for the database engine.

            • db.sampledload.avg - the raw number of active sessions for the database engine.

            If the number of active sessions is less than an internal Performance Insights threshold, db.load.avg and db.sampledload.avg are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with db.load.avg showing the scaled values, db.sampledload.avg showing the raw values, and db.sampledload.avg less than db.load.avg. For most use cases, you can query db.load.avg only.

          • Dimensions — (map<String>)

            The valid dimensions for the metric.

        • DataPoints — (Array<map>)

          An array of timestamp-value pairs, representing measurements over a period of time.

          • Timestamprequired — (Date)

            The time, in epoch format, associated with a particular Value.

          • Valuerequired — (Float)

            The actual value associated with a particular Timestamp.

      • NextToken — (String)

        An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.