Returns a list of all the metrics associated with the specified check.
540856
def list_metrics(self, entity, check, limit=None, marker=None,
            return_next=False):
        
        return entity.list_metrics(check, limit=limit, marker=marker,
                return_next=return_next)
383425
def get_checks(self, position=None):
        """"""
        if position is None:
            position = self.position
        return self.checkdefs[position][0]
595718
public java.util.List<MetricCollectionType> getMetrics() {
        if (metrics == null) {
            metrics = new com.amazonaws.internal.SdkInternalList<MetricCollectionType>();
        }
        return metrics;
    }
891256
def CollectMetrics(self, request, context):
        """"""
        LOG.debug("CollectMetrics called")
        try:
            metrics_to_collect = []
            for metric in request.metrics:
                metrics_to_collect.append(Metric(pb=metric))
            metrics_collected = self.plugin.collect(metrics_to_collect)
            return MetricsReply(metrics=[m.pb for m in metrics_collected])
        except Exception as err:
            msg = "message: {}\n\nstack trace: {}".format(
                err, traceback.format_exc())
            return MetricsReply(metrics=[], error=msg)
1193839
def _list_metric_descriptors(args, _):
  """"""
  project_id = args['project']
  pattern = args['type'] or '*'
  descriptors = gcm.MetricDescriptors(project_id=project_id)
  dataframe = descriptors.as_dataframe(pattern=pattern)
  return _render_dataframe(dataframe)
1267103
async def get_metrics(self, element):
        """"""
        await self.get_data()
        await self.get_plugins()

        if element in self.plugins:
            self.values = self.data[element]
        else:
            raise exceptions.GlancesApiError("Element data not available")
1249616
def metrics_for_mode(self, mode):
    """"""
    if mode not in self._values:
      logging.info("Mode %s not found", mode)
      return []
    return sorted(list(self._values[mode].keys()))
1259057
public java.util.List<TrustedAdvisorCheckDescription> getChecks() {
        if (checks == null) {
            checks = new com.amazonaws.internal.SdkInternalList<TrustedAdvisorCheckDescription>();
        }
        return checks;
    }
1279346
def _get_checks(self, checkclass, skip_checks):
        
        meths = inspect.getmembers(checkclass, inspect.ismethod)
        # return all check methods not among the skipped checks
        returned_checks = []
        for fn_name, fn_obj in meths:
            if (fn_name.startswith("check_") and
                skip_checks[fn_name] != BaseCheck.HIGH):
                returned_checks.append((fn_obj, skip_checks[fn_name]))

        return returned_checks
563051
public java.util.List<MetricDataResult> getMetricDataResults() {
        if (metricDataResults == null) {
            metricDataResults = new com.amazonaws.internal.SdkInternalList<MetricDataResult>();
        }
        return metricDataResults;
    }
944439
def get_check_threads(self):
        """"""
        for t in self.threads:
            name = t.getName()
            if name.startswith("CheckThread-"):
                yield name
1202442
public List<Metric> getAverages(int span) {
        Map<String,Metric> accum = new LinkedHashMap<>();
        int count = span / period;
        if (count > dataList.size())
            count = dataList.size();
        for (int i = dataList.size() - count; i < dataList.size(); i++) {
            MetricData metricData = dataList.get(i);
            for (Metric metric : metricData.getMetrics()) {
                Metric total = accum.get(metric.getName());
                if (total == null) {
                    total = new Metric(metric.getId(), metric.getName(), metric.getValue());
                    accum.put(metric.getName(), total);
                }
                else {
                    total.setValue(total.getValue() + metric.getValue());
                }
            }
        }
        for (Metric metric : accum.values()) {
            metric.setValue(Math.round((double)metric.getValue() / count));
        }
        return new ArrayList<>(accum.values());
    }
75587
def show_metrics(metrics, all_branches=False, all_tags=False):
    
    for branch, val in metrics.items():
        if all_branches or all_tags:
            logger.info("{branch}:".format(branch=branch))

        for fname, metric in val.items():
            lines = metric if type(metric) is list else metric.splitlines()

            if len(lines) > 1:
                logger.info("\t{fname}:".format(fname=fname))

                for line in lines:
                    logger.info("\t\t{content}".format(content=line))

            else:
                logger.info("\t{}: {}".format(fname, metric))
1230049
private List<Metric> mapping(List<Metric> metrics) {
        SystemAssert.requireArgument(metrics != null, "Cannot transform empty metric/metrics");
        if (metrics.isEmpty()) {
            return metrics;
        }

        List<Metric> newMetricsList = new ArrayList<Metric>();

        for (Metric metric : metrics) {
            Map<Long, Double> cleanDatapoints = cleanDPs(metric.getDatapoints());

            metric.setDatapoints(this.valueMapping.mapping(cleanDatapoints));
            newMetricsList.add(metric);
        }
        return newMetricsList;
    }
793417
def collect(self):
        
        performance_indicators = {
            'ns': 'network_send',
            'nr': 'network_receive',
            'dw': 'disk_write',
            'dr': 'disk_read',
            'al': 'activity_log',
            'bm': 'bit_map',
            'lo': 'local_count',
            'pe': 'pending',
            'ua': 'unacknowledged',
            'ap': 'application_pending',
            'ep': 'epochs',
            'wo': 'write_order',
            'oos': 'out_of_sync',
            'cs': 'connection_state',
            'ro': 'roles',
            'ds': 'disk_states'
        }

        results = dict()
        try:
            statusfile = open('/proc/drbd', 'r')
            current_resource = ''
            for line in statusfile:
                if re.search('version', line) is None:
                    if re.search(r' \d: cs', line):
                        matches = re.match(r' (\d): (cs:\w+) (ro:\w+/\w+) '
                                           '(ds:\w+/\w+) (\w{1}) .*', line)
                        current_resource = matches.group(1)
                        results[current_resource] = dict()
                    elif re.search(r'\sns:', line):
                        metrics = line.strip().split(" ")
                        for metric in metrics:
                            item, value = metric.split(":")
                            results[current_resource][
                                performance_indicators[item]] = value

                else:
                    continue
            statusfile.close()
        except IOError as errormsg:
            self.log.error("Can't read DRBD status file: {}".format(errormsg))
            return

        for resource in results.keys():
            for metric_name, metric_value in results[resource].items():
                if metric_value.isdigit():
                    self.publish(resource + "." + metric_name, metric_value)
                else:
                    continue
420098
private static List<Tag<?>> getForkMetricsTags(State state, int index) {
    return ImmutableList.<Tag<?>>of(new Tag<>(FORK_METRICS_BRANCH_NAME_KEY, getForkMetricsId(state, index)));
  }
695385
def __get_metrics(self):
        
        esfilters_close = None
        esfilters_submit = None
        if self.esfilters:
            esfilters_close = self.esfilters.copy()
            esfilters_submit = self.esfilters.copy()

        closed = ClosedPR(self.es_url, self.es_index,
                          start=self.start, end=self.end,
                          esfilters=esfilters_close, interval=self.interval)
        # For BMI we need when the ticket was closed
        closed.FIELD_DATE = 'closed_at'
        submitted = SubmittedPR(self.es_url, self.es_index,
                                start=self.start, end=self.end,
                                esfilters=esfilters_submit,
                                interval=self.interval)

        return (closed, submitted)