aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/lib/_metric_resolvers.py
blob: 270eb78345c8348944be64183bb06cd41b2a6124 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import re

VALUE_PATTERN = re.compile(r"^\s*(?P<value>\d+)\s*$")


def resolve_value(val):
    match = VALUE_PATTERN.match(val)
    if not match:
        return None
    val = match.group('value')
    return int(val)