(metric)
return MetricParseResult(
        oids_to_fetch=[parsed_symbol.oid],
        oids_to_resolve=parsed_symbol.oids_to_resolve,
        parsed_metrics=[parsed_symbol_metric],
        index_mappings=[],
        table_batches={},
    )
Parse a symbol metric (= an OID in a MIB).

    Example:

    ```
    metrics:
      - MIB: IF-MIB
        symbol: <string or OID/name object>
      - MIB: IF-MIB
        symbol:                     # MIB-less syntax
          OID: 1.3.6.1.2.1.6.5.0
          name: tcpActiveOpens
      - MIB: IF-MIB
        symbol: tcpActiveOpens      # require MIB syntax
    ```
Parse a symbol metric (= an OID in a MIB).
Parse a symbol metric ( = an OID in a MIB ) .
def _parse_symbol_metric(metric):
    # type: (SymbolMetric) -> MetricParseResult
    """
    Parse a symbol metric (= an OID in a MIB).

    Example:

    ```
    metrics:
      - MIB: IF-MIB
        symbol: <string or OID/name object>
      - MIB: IF-MIB
        symbol:                     # MIB-less syntax
          OID: 1.3.6.1.2.1.6.5.0
          name: tcpActiveOpens
      - MIB: IF-MIB
        symbol: tcpActiveOpens      # require MIB syntax
    ```
    """
    mib = metric['MIB']
    symbol = metric['symbol']

    parsed_symbol = _parse_symbol(mib, symbol)

    parsed_symbol_metric = ParsedSymbolMetric(
        parsed_symbol.name,
        tags=metric.get('metric_tags', []),
        forced_type=metric.get('forced_type'),
        options=metric.get('options', {}),
        extract_value_pattern=parsed_symbol.extract_value_pattern,
    )

    return MetricParseResult(
        oids_to_fetch=[parsed_symbol.oid],
        oids_to_resolve=parsed_symbol.oids_to_resolve,
        parsed_metrics=[parsed_symbol_metric],
        index_mappings=[],
        table_batches={},
    )
def _parse_symbol_metric ( metric ) : # type: (SymbolMetric) -> MetricParseResult mib = metric [ 'MIB' ] symbol = metric [ 'symbol' ] parsed_symbol = _parse_symbol ( mib , symbol ) parsed_symbol_metric = ParsedSymbolMetric ( parsed_symbol . name , tags = metric . get ( 'metric_tags' , [ ] ) , forced_type = metric . get ( 'forced_type' ) , options = metric . get ( 'options' , { } ) , extract_value_pattern = parsed_symbol . extract_value_pattern , ) return MetricParseResult ( oids_to_fetch = [ parsed_symbol . oid ] , oids_to_resolve = parsed_symbol . oids_to_resolve , parsed_metrics = [ parsed_symbol_metric ] , index_mappings = [ ] , table_batches = { } , )