prm/prm/detector.py
def _get_threshold_metrics(self):
        """Encode threshold objects as OWCA metrics.
        In contrast to *_threshold metrics from Container,
        all utilization partitions are exposed for all workloads.
        """
        metrics = []
        # Only when debugging is enabled.
        if log.getEffectiveLevel() == logging.DEBUG:
            for cid, threshold in self.analyzer.threshold.items():
                if cid == 'lcutilmax':
                    metrics.append(
                        OwcaMetric(name='threshold_lcutilmax', value=threshold)
                    )
                    continue
                if 'tdp' in threshold and 'bar' in threshold['tdp']:
                    metrics.extend([
                        OwcaMetric(
                            name='threshold_tdp_bar',
                            value=threshold['tdp']['bar'],
                            labels=dict(cid=cid)),
                        OwcaMetric(
                            name='threshold_tdp_util',
                            value=threshold['tdp']['util'],
                            labels=dict(cid=cid)),
                    ])
                if 'thresh' in threshold:
                    for d in threshold['thresh']:
                        metrics.extend([
                            OwcaMetric(
                                name='threshold_cpi',
                                labels=dict(start=str(int(d['util_start'])),
                                            end=str(int(d['util_end'])), cid=cid),
                                value=d['cpi']),
                            OwcaMetric(
                                name='threshold_mpki',
                                labels=dict(start=str(int(d['util_start'])),
                                            end=str(int(d['util_end'])), cid=cid),
                                value=(d['mpki'])),
                            OwcaMetric(
                                name='threshold_mb',
                                labels=dict(start=str(int(d['util_start'])),
                                            end=str(int(d['util_end'])), cid=cid),
                                value=(d['mb'])),
                        ])

        return metrics
Encode threshold objects as OWCA metrics.
        In contrast to *_threshold metrics from Container,
        all utilization partitions are exposed for all workloads.
        
Encode threshold objects as OWCA metrics.
In contrast to *_threshold metrics from Container,
all utilization partitions are exposed for all workloads.
Encode threshold objects as OWCA metrics . In contrast to * _threshold metrics from Container all utilization partitions are exposed for all workloads .
def _get_threshold_metrics(self):
        metrics = []
        if log.getEffectiveLevel() == logging.DEBUG:
            for cid, threshold in self.analyzer.threshold.items():
                if cid == 'lcutilmax':
                    metrics.append(
                        OwcaMetric(name='threshold_lcutilmax', value=threshold)
                    )
                    continue
                if 'tdp' in threshold and 'bar' in threshold['tdp']:
                    metrics.extend([
                        OwcaMetric(
                            name='threshold_tdp_bar',
                            value=threshold['tdp']['bar'],
                            labels=dict(cid=cid)),
                        OwcaMetric(
                            name='threshold_tdp_util',
                            value=threshold['tdp']['util'],
                            labels=dict(cid=cid)),
                    ])
                if 'thresh' in threshold:
                    for d in threshold['thresh']:
                        metrics.extend([
                            OwcaMetric(
                                name='threshold_cpi',
                                labels=dict(start=str(int(d['util_start'])),
                                            end=str(int(d['util_end'])), cid=cid),
                                value=d['cpi']),
                            OwcaMetric(
                                name='threshold_mpki',
                                labels=dict(start=str(int(d['util_start'])),
                                            end=str(int(d['util_end'])), cid=cid),
                                value=(d['mpki'])),
                            OwcaMetric(
                                name='threshold_mb',
                                labels=dict(start=str(int(d['util_start'])),
                                            end=str(int(d['util_end'])), cid=cid),
                                value=(d['mb'])),
                        ])
        return metrics
def _get_threshold_metrics ( self ) : metrics = [ ] if log . getEffectiveLevel ( ) == logging . DEBUG : for cid , threshold in self . analyzer . threshold . items ( ) : if cid == 'lcutilmax' : metrics . append ( OwcaMetric ( name = 'threshold_lcutilmax' , value = threshold ) ) continue if 'tdp' in threshold and 'bar' in threshold [ 'tdp' ] : metrics . extend ( [ OwcaMetric ( name = 'threshold_tdp_bar' , value = threshold [ 'tdp' ] [ 'bar' ] , labels = dict ( cid = cid ) ) , OwcaMetric ( name = 'threshold_tdp_util' , value = threshold [ 'tdp' ] [ 'util' ] , labels = dict ( cid = cid ) ) , ] ) if 'thresh' in threshold : for d in threshold [ 'thresh' ] : metrics . extend ( [ OwcaMetric ( name = 'threshold_cpi' , labels = dict ( start = str ( int ( d [ 'util_start' ] ) ) , end = str ( int ( d [ 'util_end' ] ) ) , cid = cid ) , value = d [ 'cpi' ] ) , OwcaMetric ( name = 'threshold_mpki' , labels = dict ( start = str ( int ( d [ 'util_start' ] ) ) , end = str ( int ( d [ 'util_end' ] ) ) , cid = cid ) , value = ( d [ 'mpki' ] ) ) , OwcaMetric ( name = 'threshold_mb' , labels = dict ( start = str ( int ( d [ 'util_start' ] ) ) , end = str ( int ( d [ 'util_end' ] ) ) , cid = cid ) , value = ( d [ 'mb' ] ) ) , ] ) return metrics
Encode threshold objects as OWCA metrics.
Encode threshold objects as OWCA metrics .
"""Encode threshold objects as OWCA metrics.
        In contrast to *_threshold metrics from Container,
        all utilization partitions are exposed for all workloads.
        """ # Only when debugging is enabled.
self