Ejemplo n.º 1
0
 def _validate_single_metric(self, metric):
     validation.metric_name(metric['name'])
     assert isinstance(metric['timestamp'], (int, float)), "Timestamp must be a number"
     assert isinstance(metric['value'], (int, long, float)), "Value must be a number"
     if "dimensions" in metric:
         for dimension_key in metric['dimensions']:
             validation.dimension_key(dimension_key)
             validation.dimension_value(metric['dimensions'][dimension_key])
     if "value_meta" in metric:
             validation.validate_value_meta(metric['value_meta'])
Ejemplo n.º 2
0
 def _validate_single_metric(self, metric):
     validation.metric_name(metric['name'])
     assert isinstance(metric['timestamp'], (int, float)), "Timestamp must be a number"
     assert isinstance(metric['value'], (int, long, float)), "Value must be a number"
     if "dimensions" in metric:
         for dimension_key in metric['dimensions']:
             validation.dimension_key(dimension_key)
             validation.dimension_value(metric['dimensions'][dimension_key])
     if "value_meta" in metric:
             validation.validate_value_meta(metric['value_meta'])
Ejemplo n.º 3
0
 def test_valid_value(self):
     value_meta_value = "this.is_a.valid-value"
     value_meta = {'value_meta_name': value_meta_value}
     validation.validate_value_meta(value_meta)
     self.assertTrue(True)
Ejemplo n.º 4
0
 def test_valid_name(self):
     value_meta_name = "this.is_a.valid-name"
     value_meta = {value_meta_name: 'value_meta_value'}
     validation.validate_value_meta(value_meta)
     self.assertTrue(True)
Ejemplo n.º 5
0
 def test_valid_value(self):
     value_meta_value = "this.is_a.valid-value"
     value_meta = {'value_meta_name': value_meta_value}
     validation.validate_value_meta(value_meta)
     self.assertTrue(True)
Ejemplo n.º 6
0
 def test_valid_name(self):
     value_meta_name = "this.is_a.valid-name"
     value_meta = {value_meta_name: 'value_meta_value'}
     validation.validate_value_meta(value_meta)
     self.assertTrue(True)