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:
41
41
Gauge = 'gauges'
42
42
Availability = 'availability'
43
43
Counter = 'counters'
44
+ String = 'strings'
44
45
Rate = 'rate'
45
46
_Metrics = 'metrics'
46
47
@@ -50,6 +51,8 @@ def short(metric_type):
50
51
return 'gauge'
51
52
elif metric_type is MetricType .Counter :
52
53
return 'counter'
54
+ elif metric_type is MetricType .String :
55
+ return 'string'
53
56
else :
54
57
return 'availability'
55
58
Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ def test_add_availability_single(self):
174
174
down = self .client .query_metric (MetricType .Availability , 'test.avail.2' )
175
175
self .assertEqual (down [0 ]['value' ], Availability .Down )
176
176
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
+
177
182
def test_add_gauge_multi_datapoint (self ):
178
183
metric_1v = create_datapoint (float (1.45 ))
179
184
metric_2v = create_datapoint (float (2.00 ), (time_millis () - 2000 ))
You can’t perform that action at this time.
0 commit comments