(
        self,
        key: str,
        start_time: Optional[Arrow] = None,
        end_time: Optional[Arrow] = None,
        step: Optional[timedelta] = None,
    )
Compute the capacity for the cluster in the specified time range, grouped into chunks

        :param key: the type of data to retreive; must correspond to a key in REPORT_TYPES
        :param start_time: the lower bound of the range (if None, use simulation start time)
        :param end_time: the upper bound of the range (if None, use simulation end time)
        :param step: the width of time for each chunk
        :returns: a list of CPU capacities for the cluster from start_time to end_time
Compute the capacity for the cluster in the specified time range, grouped into chunks
Compute the capacity for the cluster in the specified time range grouped into chunks
def get_data(
        self,
        key: str,
        start_time: Optional[Arrow] = None,
        end_time: Optional[Arrow] = None,
        step: Optional[timedelta] = None,
    ) -> "SortedDict[Arrow, float]":
        """ Compute the capacity for the cluster in the specified time range, grouped into chunks

        :param key: the type of data to retreive; must correspond to a key in REPORT_TYPES
        :param start_time: the lower bound of the range (if None, use simulation start time)
        :param end_time: the upper bound of the range (if None, use simulation end time)
        :param step: the width of time for each chunk
        :returns: a list of CPU capacities for the cluster from start_time to end_time
        """
        start_time = start_time or self.start_time
        end_time = end_time or self.end_time
        if key == "cpus":
            return self.mesos_cpus.values(start_time, end_time, step)
        elif key == "cpus_allocated":
            return self.mesos_cpus_allocated.values(start_time, end_time, step)
        elif key == "unused_cpus":
            # If an agent hasn't joined the cluster yet, we'll treat it as "unused" in the simulation
            unused_cpus = self.aws_cpus - self.mesos_cpus_allocated
            return unused_cpus.values(start_time, end_time, step)
        elif key == "cost":
            return self.cost_per_hour.integrals(start_time, end_time, step, transform=hour_transform)
        elif key == "unused_cpus_cost":
            # Here we treat CPUs that haven't joined the Mesos cluster as un-allocated.  It's arguable
            # if that's the right way to do this or not.
            percent_unallocated = (self.aws_cpus - self.mesos_cpus_allocated) / self.aws_cpus
            percent_cost = percent_unallocated * self.cost_per_hour
            return percent_cost.integrals(start_time, end_time, step, transform=hour_transform)
        elif key == "cost_per_cpu":
            cost_per_cpu = self.cost_per_hour / self.aws_cpus
            return cost_per_cpu.values(start_time, end_time, step)
        elif key == "oversubscribed":
            max_fn = piecewise_max(self.mesos_cpus_allocated - self.aws_cpus, PiecewiseConstantFunction())
            return max_fn.values(start_time, end_time, step)
        else:
            raise ValueError(f"Data key {key} is not recognized")
def get_data ( self , key : str , start_time : Optional [ Arrow ] = None , end_time : Optional [ Arrow ] = None , step : Optional [ timedelta ] = None , ) -> "SortedDict[Arrow, float]" : start_time = start_time or self . start_time end_time = end_time or self . end_time if key == "cpus" : return self . mesos_cpus . values ( start_time , end_time , step ) elif key == "cpus_allocated" : return self . mesos_cpus_allocated . values ( start_time , end_time , step ) elif key == "unused_cpus" : # If an agent hasn't joined the cluster yet, we'll treat it as "unused" in the simulation unused_cpus = self . aws_cpus - self . mesos_cpus_allocated return unused_cpus . values ( start_time , end_time , step ) elif key == "cost" : return self . cost_per_hour . integrals ( start_time , end_time , step , transform = hour_transform ) elif key == "unused_cpus_cost" : # Here we treat CPUs that haven't joined the Mesos cluster as un-allocated.  It's arguable # if that's the right way to do this or not. percent_unallocated = ( self . aws_cpus - self . mesos_cpus_allocated ) / self . aws_cpus percent_cost = percent_unallocated * self . cost_per_hour return percent_cost . integrals ( start_time , end_time , step , transform = hour_transform ) elif key == "cost_per_cpu" : cost_per_cpu = self . cost_per_hour / self . aws_cpus return cost_per_cpu . values ( start_time , end_time , step ) elif key == "oversubscribed" : max_fn = piecewise_max ( self . mesos_cpus_allocated - self . aws_cpus , PiecewiseConstantFunction ( ) ) return max_fn . values ( start_time , end_time , step ) else : raise ValueError ( f"Data key {key} is not recognized" )