prm/prm/container.py
def update_measurement(self, timestamp: float, measurements: Measurements):
        """
        update measurements in current cycle and calculate metrics
        """
        if self.measurements:
            metrics = self.metrics
            delta_t = timestamp - self.timestamp
            metrics[Metric.CYC] = measurements[MetricName.CYCLES] -\
                self.measurements[MetricName.CYCLES]
            metrics[Metric.INST] = measurements[MetricName.INSTRUCTIONS] -\
                self.measurements[MetricName.INSTRUCTIONS]
            metrics[Metric.L3MISS] = measurements[MetricName.CACHE_MISSES] -\
                self.measurements[MetricName.CACHE_MISSES]
            metrics[Metric.L3OCC] = measurements[MetricName.LLC_OCCUPANCY] / 1024
            if metrics[Metric.INST] == 0:
                metrics[Metric.CPI] = 0
                metrics[Metric.L3MPKI] = 0
            else:
                metrics[Metric.CPI] = metrics[Metric.CYC] /\
                    metrics[Metric.INST]
                metrics[Metric.L3MPKI] = metrics[Metric.L3MISS] * 1000 /\
                    metrics[Metric.INST]
            metrics[Metric.UTIL] = (measurements[MetricName.CPU_USAGE_PER_TASK]
                                    - self.measurements[MetricName.CPU_USAGE_PER_TASK])\
                * 100 / (delta_t * 1e9)
            metrics[Metric.MB] = (measurements[MetricName.MEM_BW] -
                                  self.measurements[MetricName.MEM_BW]) /\
                1024 / 1024 / delta_t
            if metrics[Metric.UTIL] == 0:
                metrics[Metric.NF] = 0
            else:
                metrics[Metric.NF] = metrics[Metric.CYC] / delta_t / 10000 /\
                    metrics[Metric.UTIL]
            self._update_metrics_history()

        self.measurements = measurements
        self.timestamp = timestamp

        update measurements in current cycle and calculate metrics
        
update measurements in current cycle and calculate metrics
update measurements in current cycle and calculate metrics
def update_measurement(self, timestamp: float, measurements: Measurements):
        if self.measurements:
            metrics = self.metrics
            delta_t = timestamp - self.timestamp
            metrics[Metric.CYC] = measurements[MetricName.CYCLES] -\
                self.measurements[MetricName.CYCLES]
            metrics[Metric.INST] = measurements[MetricName.INSTRUCTIONS] -\
                self.measurements[MetricName.INSTRUCTIONS]
            metrics[Metric.L3MISS] = measurements[MetricName.CACHE_MISSES] -\
                self.measurements[MetricName.CACHE_MISSES]
            metrics[Metric.L3OCC] = measurements[MetricName.LLC_OCCUPANCY] / 1024
            if metrics[Metric.INST] == 0:
                metrics[Metric.CPI] = 0
                metrics[Metric.L3MPKI] = 0
            else:
                metrics[Metric.CPI] = metrics[Metric.CYC] /\
                    metrics[Metric.INST]
                metrics[Metric.L3MPKI] = metrics[Metric.L3MISS] * 1000 /\
                    metrics[Metric.INST]
            metrics[Metric.UTIL] = (measurements[MetricName.CPU_USAGE_PER_TASK]
                                    - self.measurements[MetricName.CPU_USAGE_PER_TASK])\
                * 100 / (delta_t * 1e9)
            metrics[Metric.MB] = (measurements[MetricName.MEM_BW] -
                                  self.measurements[MetricName.MEM_BW]) /\
                1024 / 1024 / delta_t
            if metrics[Metric.UTIL] == 0:
                metrics[Metric.NF] = 0
            else:
                metrics[Metric.NF] = metrics[Metric.CYC] / delta_t / 10000 /\
                    metrics[Metric.UTIL]
            self._update_metrics_history()
        self.measurements = measurements
        self.timestamp = timestamp
def update_measurement ( self , timestamp : float , measurements : Measurements ) : if self . measurements : metrics = self . metrics delta_t = timestamp - self . timestamp metrics [ Metric . CYC ] = measurements [ MetricName . CYCLES ] - self . measurements [ MetricName . CYCLES ] metrics [ Metric . INST ] = measurements [ MetricName . INSTRUCTIONS ] - self . measurements [ MetricName . INSTRUCTIONS ] metrics [ Metric . L3MISS ] = measurements [ MetricName . CACHE_MISSES ] - self . measurements [ MetricName . CACHE_MISSES ] metrics [ Metric . L3OCC ] = measurements [ MetricName . LLC_OCCUPANCY ] / 1024 if metrics [ Metric . INST ] == 0 : metrics [ Metric . CPI ] = 0 metrics [ Metric . L3MPKI ] = 0 else : metrics [ Metric . CPI ] = metrics [ Metric . CYC ] / metrics [ Metric . INST ] metrics [ Metric . L3MPKI ] = metrics [ Metric . L3MISS ] * 1000 / metrics [ Metric . INST ] metrics [ Metric . UTIL ] = ( measurements [ MetricName . CPU_USAGE_PER_TASK ] - self . measurements [ MetricName . CPU_USAGE_PER_TASK ] ) * 100 / ( delta_t * 1e9 ) metrics [ Metric . MB ] = ( measurements [ MetricName . MEM_BW ] - self . measurements [ MetricName . MEM_BW ] ) / 1024 / 1024 / delta_t if metrics [ Metric . UTIL ] == 0 : metrics [ Metric . NF ] = 0 else : metrics [ Metric . NF ] = metrics [ Metric . CYC ] / delta_t / 10000 / metrics [ Metric . UTIL ] self . _update_metrics_history ( ) self . measurements = measurements self . timestamp = timestamp
update measurements in current cycle and calculate metrics
update measurements in current cycle and calculate metrics
"""
        update measurements in current cycle and calculate metrics
        """
self
timestamp
float
measurements
Measurements