Beispiel #1
0
 def set_list_instances(self, insts):
     instance_count = len(insts)
     instance_array = (pmdaInstid * instance_count)()
     for i in range(instance_count):
         instance_array[i].i_inst = insts[i].i_inst
         instance_array[i].i_name = insts[i].i_name
     self.it_set = instance_array
     self.it_numinst = instance_count
     cpmda.set_need_refresh()
Beispiel #2
0
    def add_metric(self, name, metric, oneline='', text=''):
        pmid = metric.m_desc.pmid
        if (pmid in self._metric_names):
            raise KeyError('attempt to add_metric with an existing name')
        if (pmid in self._metrics):
            raise KeyError('attempt to add_metric with an existing PMID')

        self._metrictable.append(metric)
        self._metrics[pmid] = metric
        self._metric_names[pmid] = name
        self._metric_oneline[pmid] = oneline
        self._metric_helptext[pmid] = text
        cpmda.set_need_refresh()
Beispiel #3
0
    def add_metric(self, name, metric, oneline = '', text = ''):
        pmid = metric.m_desc.pmid
        if (pmid in self._metric_names):
            raise KeyError('attempt to add_metric with an existing name')
        if (pmid in self._metrics):
            raise KeyError('attempt to add_metric with an existing PMID')

        self._metrictable.append(metric)
        self._metrics[pmid] = metric
        self._metric_names[pmid] = name
        self._metric_oneline[pmid] = oneline
        self._metric_helptext[pmid] = text
        cpmda.set_need_refresh()
Beispiel #4
0
    def remove_metric(self, name, metric):
        pmid = metric.m_desc.pmid
        if (name not in self._metric_names_map):
            raise KeyError('attempt to remove non-existant metric name=%s' % (name))
        if (pmid not in self._metrics):
            raise KeyError('attempt to remove_metric with non-existant PMID')

        self._metrictable.remove(metric)
        self._metrics.pop(pmid)
        self._metric_names.pop(pmid)
        self._metric_names_map.pop(name)
        self._metric_oneline.pop(pmid)
        self._metric_helptext.pop(pmid)
        cpmda.set_need_refresh()
Beispiel #5
0
 def reset_metrics(self):
     self.clear_metrics()
     cpmda.set_need_refresh()
Beispiel #6
0
 def reset_metrics(self):
     self.clear_metrics()
     cpmda.set_need_refresh()