Exemplo n.º 1
0
def test_translate_serieslist_to_regex(series, matches, nonmatches):
    pattern = translate_serieslist_to_regex(series)
    for string in matches:
        assert pattern.match(string), "%s doesn't match %s" % (string, series)

    for string in nonmatches:
        assert not pattern.match(string), "%s matches %s" % (string, series)
Exemplo n.º 2
0
 def get_pattern(self):
     """
     Returns a compiled regexp pattern that represents the target metrics
     of this rule.
     """
     series = extract_series_name(self.target)
     pat = translate_serieslist_to_regex(series)
     return pat
Exemplo n.º 3
0
 def get_pattern(self):
     """
     Returns a compiled regexp pattern that represents the target metrics
     of this rule.
     """
     series = extract_series_name(self.target)
     pat = translate_serieslist_to_regex(series)
     return pat