@@ -164,7 +164,7 @@ def test_guaranteed_throughput_probabilistic_sampler():
164
164
assert tags == get_tags ('lowerbound' , 0.5 )
165
165
sampled , _ = sampler .is_sampled (MAX_INT + 10 )
166
166
assert not sampled
167
- assert '%s' % sampler == 'GuaranteedThroughputProbabilisticSampler(op, 0.5, 2)'
167
+ assert '%s' % sampler == 'GuaranteedThroughputProbabilisticSampler(op, 0.5, 2.0 )'
168
168
169
169
sampler .update (3 , 0.51 )
170
170
sampled , tags = sampler .is_sampled (MAX_INT - 10 )
@@ -174,7 +174,7 @@ def test_guaranteed_throughput_probabilistic_sampler():
174
174
assert sampled
175
175
assert tags == get_tags ('lowerbound' , 0.51 )
176
176
177
- assert '%s' % sampler == 'GuaranteedThroughputProbabilisticSampler(op, 0.51, 3)'
177
+ assert '%s' % sampler == 'GuaranteedThroughputProbabilisticSampler(op, 0.51, 3.0 )'
178
178
sampler .close ()
179
179
180
180
@@ -212,7 +212,7 @@ def test_adaptive_sampler():
212
212
assert tags == get_tags ('probabilistic' , 0.51 )
213
213
sampled , _ = sampler .is_sampled (MAX_INT + (old_div (MAX_INT ,4 )), "new_op_2" )
214
214
assert not sampled
215
- assert '%s' % sampler == 'AdaptiveSampler(0.51, 3, 2)'
215
+ assert '%s' % sampler == 'AdaptiveSampler(0.51, 3.0 , 2)'
216
216
217
217
# Update the strategies
218
218
strategies = {
@@ -245,7 +245,7 @@ def test_adaptive_sampler():
245
245
sampled , tags = sampler .is_sampled (MAX_INT - 10 , 'new_op_3' )
246
246
assert sampled
247
247
assert tags == get_tags ('probabilistic' , 0.53 )
248
- assert '%s' % sampler == 'AdaptiveSampler(0.52, 4, 2)'
248
+ assert '%s' % sampler == 'AdaptiveSampler(0.52, 4.0 , 2)'
249
249
250
250
sampler .close ()
251
251
@@ -271,12 +271,12 @@ def test_adaptive_sampler_default_values():
271
271
}
272
272
]
273
273
})
274
- assert '%s' % adaptive_sampler == 'AdaptiveSampler(0.001, 4, 2)'
274
+ assert '%s' % adaptive_sampler == 'AdaptiveSampler(0.001, 4.0 , 2)'
275
275
276
276
sampled , tags = adaptive_sampler .is_sampled (0 , 'new_op' )
277
277
assert sampled
278
278
assert tags == get_tags ('probabilistic' , 0.002 )
279
- assert '%s' % adaptive_sampler .samplers ['new_op' ] == 'GuaranteedThroughputProbabilisticSampler(new_op, 0.002, 4)'
279
+ assert '%s' % adaptive_sampler .samplers ['new_op' ] == 'GuaranteedThroughputProbabilisticSampler(new_op, 0.002, 4.0 )'
280
280
281
281
sampled , tags = adaptive_sampler .is_sampled (0 , 'op' )
282
282
assert sampled
@@ -398,7 +398,7 @@ def test_sampling_request_callback():
398
398
return_value .result = lambda * args : \
399
399
type ('obj' , (object ,), {'body' : adaptive_sampling_strategy })()
400
400
sampler ._sampling_request_callback (return_value )
401
- assert '%s' % sampler .sampler == 'AdaptiveSampler(0.001, 2, 10)' , 'sampler should have changed to adaptive'
401
+ assert '%s' % sampler .sampler == 'AdaptiveSampler(0.001, 2.0 , 10)' , 'sampler should have changed to adaptive'
402
402
prev_sampler = sampler .sampler
403
403
404
404
sampler ._sampling_request_callback (return_value )
@@ -555,7 +555,7 @@ def test_update_sampler_adaptive_sampler():
555
555
}
556
556
557
557
remote_sampler ._update_sampler (response )
558
- assert '%s' % remote_sampler .sampler == 'AdaptiveSampler(0.001, 2, 10)'
558
+ assert '%s' % remote_sampler .sampler == 'AdaptiveSampler(0.001, 2.0 , 10)'
559
559
560
560
new_response = {
561
561
"strategyType" :1 ,
@@ -576,7 +576,7 @@ def test_update_sampler_adaptive_sampler():
576
576
}
577
577
578
578
remote_sampler ._update_sampler (new_response )
579
- assert '%s' % remote_sampler .sampler == 'AdaptiveSampler(0.51, 3, 10)'
579
+ assert '%s' % remote_sampler .sampler == 'AdaptiveSampler(0.51, 3.0 , 10)'
580
580
581
581
remote_sampler ._update_sampler ({"strategyType" :0 ,"probabilisticSampling" :{"samplingRate" :0.004 }})
582
582
assert '%s' % remote_sampler .sampler == 'ProbabilisticSampler(0.004)' , \
0 commit comments