_metric_resolvers.py 217 B

1234567891011
  1. import re
  2. VALUE_PATTERN = re.compile(r"^\s*(?P<value>\d+)\s*$")
  3. def resolve_value(val):
  4. match = VALUE_PATTERN.match(val)
  5. if not match:
  6. return None
  7. val = match.group('value')
  8. return int(val)