docs: def _get_metric(self, metric, tablename, index_name=None):
          """ Fetch a read/write capacity metric """
          end = time.time()
          begin = end - 3 * 60  # 3 minute window
          dimensions = [{"Name": "TableName", "Value": tablename}]
          if index_name is not None:
              dimensions.append({"Name": "GlobalSecondaryIndexName", "Value": index_name})
          period = 60
          data = self.cloudwatch_connection.get_metric_statistics(
              Period=period,
              StartTime=begin,
              EndTime=end,
              MetricName=metric,
              Namespace="AWS/DynamoDB",
              Statistics=["Sum"],
              Dimensions=dimensions,
          )
          points = data["Datapoints"]
          if not points:
              return 0
          else:
              points.sort(key=lambda r: r["Timestamp"])
              return float(points[-1]["Sum"]) / period