File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class MetricType:
4141 Gauge = 'gauges'
4242 Availability = 'availability'
4343 Counter = 'counters'
44+ String = 'strings'
4445 Rate = 'rate'
4546 _Metrics = 'metrics'
4647
@@ -50,6 +51,8 @@ def short(metric_type):
5051 return 'gauge'
5152 elif metric_type is MetricType .Counter :
5253 return 'counter'
54+ elif metric_type is MetricType .String :
55+ return 'string'
5356 else :
5457 return 'availability'
5558
Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ def test_add_availability_single(self):
174174 down = self .client .query_metric (MetricType .Availability , 'test.avail.2' )
175175 self .assertEqual (down [0 ]['value' ], Availability .Down )
176176
177+ def test_add_string_single (self ):
178+ self .client .push (MetricType .String , 'test.string.1' , "foo" )
179+ data = self .client .query_metric (MetricType .String , 'test.string.1' )
180+ self .assertEqual (data , 'foo' )
181+
177182 def test_add_gauge_multi_datapoint (self ):
178183 metric_1v = create_datapoint (float (1.45 ))
179184 metric_2v = create_datapoint (float (2.00 ), (time_millis () - 2000 ))
You can’t perform that action at this time.
0 commit comments