コード例 #1
0
 def build_metric(self, prefix, name, wall_time_func=None):
     if prefix:
         if not prefix[-1] == ".":
             prefix = prefix + "."
         path = prefix + name
     else:
         path = name
     result = {}
     for pattern, conditions in self.config.items():
         if fnmatch.fnmatch(path, pattern):
             result.update(conditions)
     return SLIMetricReporter(path, result)
コード例 #2
0
 def setUp(self):
     self.sli = SLIMetricReporter('test', {
                     "red": BelowCondition(5),
                     "yellow": BelowCondition(3)})