def get_throttled_by_provisioned_write_event_percent(
        table_name, gsi_name, lookback_window_start=15, lookback_period=5):
    """ Returns the number of throttled write events during a given time frame

    :type table_name: str
    :param table_name: Name of the DynamoDB table
    :type gsi_name: str
    :param gsi_name: Name of the GSI
    :type lookback_window_start: int
    :param lookback_window_start: Relative start time for the CloudWatch metric
    :type lookback_period: int
    :param lookback_period: Number of minutes to look at
    :returns: float -- Percent of throttled write events by provisioning
    """
    try:
        metrics = __get_aws_metric(
            table_name,
            gsi_name,
            lookback_window_start,
            lookback_period,
            'WriteThrottleEvents')
    except BotoServerError:
        raise

    if metrics:
        lookback_seconds = lookback_period * 60
        throttled_write_events = float(metrics[0]['Sum']) / float(
            lookback_seconds)
    else:
        throttled_write_events = 0

    try:
        gsi_write_units = dynamodb.get_provisioned_gsi_write_units(
            table_name, gsi_name)

        throttled_by_provisioned_write_percent = (
            float(throttled_write_events) /
            float(gsi_write_units) * 100)
    except JSONResponseError:
        raise

    logger.info(
        '{0} - GSI: {1} - Throttled write percent '
        'by provision: {2:.2f}%'.format(
            table_name, gsi_name, throttled_by_provisioned_write_percent))
    return throttled_by_provisioned_write_percent
Returns the number of throttled write events during a given time frame

    :type table_name: str
    :param table_name: Name of the DynamoDB table
    :type gsi_name: str
    :param gsi_name: Name of the GSI
    :type lookback_window_start: int
    :param lookback_window_start: Relative start time for the CloudWatch metric
    :type lookback_period: int
    :param lookback_period: Number of minutes to look at
    :returns: float -- Percent of throttled write events by provisioning