def _getMetricStatisticsTimeSlice(cls, period):
    """ Determine metric statistics collection time range for the maximum range
    appropriate for aggregation of the statistic values of an Autostack

    :param period: Metric period in seconds; must be multiple of 60
    :type period: integer
    :returns: time range for collecting metric statistics adjusted for integral
              number of metric periods.
    :rtype: htm-it.app.runtime.aggregator_utils.TimeRange
    """
    startTime, endTime = cloudwatch_utils.getMetricCollectionTimeRange(
      startTime=None,
      endTime=None,
      period=period)

    return TimeRange(start=startTime, end=endTime)
  def _getMetricCollectionTimeSlice(cls, startTime, period):
    """ Determine metric data collection time range.

    :param startTime: UTC start time of planned metric data collection; may be
                      None when called for the first time, in which case a start
                      time will be calculated and returned in the result (even
                      if there is not enough time for at least one period of
                      metric data collection)
    :type startTime: datetime.datetime
    :param period: Metric period in seconds; must be multiple of 60
    :type period: integer
    :returns: time range for collecting metrics adjusted for integral number of
              periods. If there is not enough time for at least one period,
              then end-time will be set equal to start-time
    :rtype: htm-it.app.runtime.aggregator_utils.TimeRange
    """
    startTime, endTime = cloudwatch_utils.getMetricCollectionTimeRange(
      startTime=startTime,
      endTime=None,
      period=period)

    return TimeRange(start=startTime, end=endTime)