@@ -127,25 +127,19 @@ class TestDistributionAggregationData(unittest.TestCase):
127127 def test_constructor (self ):
128128 mean_data = 1
129129 count_data = 0
130- _min = 0
131- _max = 1
132130 sum_of_sqd_deviations = mock .Mock ()
133131 counts_per_bucket = [1 , 1 , 1 ]
134132 bounds = [1.0 / 2.0 , 1 ]
135133
136134 dist_agg_data = aggregation_data_module .DistributionAggregationData (
137135 mean_data = mean_data ,
138136 count_data = count_data ,
139- min_ = _min ,
140- max_ = _max ,
141137 sum_of_sqd_deviations = sum_of_sqd_deviations ,
142138 counts_per_bucket = counts_per_bucket ,
143139 bounds = bounds )
144140
145141 self .assertEqual (1 , dist_agg_data .mean_data )
146142 self .assertEqual (0 , dist_agg_data .count_data )
147- self .assertEqual (0 , dist_agg_data .min )
148- self .assertEqual (1 , dist_agg_data .max )
149143 self .assertEqual (sum_of_sqd_deviations ,
150144 dist_agg_data .sum_of_sqd_deviations )
151145 self .assertEqual ([1 , 1 , 1 ], dist_agg_data .counts_per_bucket )
@@ -160,8 +154,6 @@ def test_init_bad_bucket_counts(self):
160154 aggregation_data_module .DistributionAggregationData (
161155 mean_data = mock .Mock (),
162156 count_data = mock .Mock (),
163- min_ = mock .Mock (),
164- max_ = mock .Mock (),
165157 sum_of_sqd_deviations = mock .Mock (),
166158 counts_per_bucket = [0 , 0 , 0 ],
167159 bounds = [1 , 2 , 3 ])
@@ -171,8 +163,6 @@ def test_init_bad_bucket_counts(self):
171163 aggregation_data_module .DistributionAggregationData (
172164 mean_data = mock .Mock (),
173165 count_data = mock .Mock (),
174- min_ = mock .Mock (),
175- max_ = mock .Mock (),
176166 sum_of_sqd_deviations = mock .Mock (),
177167 counts_per_bucket = [0 , 2 , - 2 , 0 ],
178168 bounds = [1 , 2 , 3 ])
@@ -181,8 +171,6 @@ def test_init_bad_bucket_counts(self):
181171 aggregation_data_module .DistributionAggregationData (
182172 mean_data = mock .Mock (),
183173 count_data = mock .Mock (),
184- min_ = mock .Mock (),
185- max_ = mock .Mock (),
186174 sum_of_sqd_deviations = mock .Mock (),
187175 counts_per_bucket = [0 , 0 , 0 , 0 ],
188176 bounds = [1 , 2 , 3 ])
@@ -193,8 +181,6 @@ def test_init_bad_bounds(self):
193181 aggregation_data_module .DistributionAggregationData (
194182 mean_data = mock .Mock (),
195183 count_data = mock .Mock (),
196- min_ = mock .Mock (),
197- max_ = mock .Mock (),
198184 sum_of_sqd_deviations = mock .Mock (),
199185 counts_per_bucket = [0 , 0 , 0 , 0 ],
200186 bounds = [1 , 2 , 2 ])
@@ -204,8 +190,6 @@ def test_init_bad_bounds(self):
204190 aggregation_data_module .DistributionAggregationData (
205191 mean_data = mock .Mock (),
206192 count_data = mock .Mock (),
207- min_ = mock .Mock (),
208- max_ = mock .Mock (),
209193 sum_of_sqd_deviations = mock .Mock (),
210194 counts_per_bucket = [0 , 0 , 0 , 0 ],
211195 bounds = [1 , 3 , 2 ])
@@ -215,8 +199,6 @@ def test_init_bad_bounds(self):
215199 aggregation_data_module .DistributionAggregationData (
216200 mean_data = mock .Mock (),
217201 count_data = mock .Mock (),
218- min_ = mock .Mock (),
219- max_ = mock .Mock (),
220202 sum_of_sqd_deviations = mock .Mock (),
221203 counts_per_bucket = [0 , 0 , 0 , 0 ],
222204 bounds = [- 1 , 1 , 2 ])
@@ -227,8 +209,6 @@ def test_init_bad_exemplars(self):
227209 aggregation_data_module .DistributionAggregationData (
228210 mean_data = mock .Mock (),
229211 count_data = mock .Mock (),
230- min_ = mock .Mock (),
231- max_ = mock .Mock (),
232212 sum_of_sqd_deviations = mock .Mock (),
233213 counts_per_bucket = mock .Mock (),
234214 bounds = None ,
@@ -239,8 +219,6 @@ def test_init_bad_exemplars(self):
239219 aggregation_data_module .DistributionAggregationData (
240220 mean_data = mock .Mock (),
241221 count_data = mock .Mock (),
242- min_ = mock .Mock (),
243- max_ = mock .Mock (),
244222 sum_of_sqd_deviations = mock .Mock (),
245223 counts_per_bucket = mock .Mock (),
246224 bounds = [0 , 1 ],
@@ -256,26 +234,20 @@ def test_constructor_with_exemplar(self):
256234 ]
257235 mean_data = 2.59
258236 count_data = 3
259- _min = .07
260- _max = 7
261237 sum_of_sqd_deviations = mock .Mock ()
262238 counts_per_bucket = [1 , 1 , 1 ]
263239 bounds = [1.0 / 2.0 , 1 ]
264240
265241 dist_agg_data = aggregation_data_module .DistributionAggregationData (
266242 mean_data = mean_data ,
267243 count_data = count_data ,
268- min_ = _min ,
269- max_ = _max ,
270244 sum_of_sqd_deviations = sum_of_sqd_deviations ,
271245 exemplars = exemplars ,
272246 counts_per_bucket = counts_per_bucket ,
273247 bounds = bounds )
274248
275249 self .assertEqual (dist_agg_data .mean_data , mean_data )
276250 self .assertEqual (dist_agg_data .count_data , count_data )
277- self .assertEqual (dist_agg_data .min , _min )
278- self .assertEqual (dist_agg_data .max , _max )
279251 self .assertEqual (dist_agg_data .sum_of_sqd_deviations ,
280252 sum_of_sqd_deviations )
281253 self .assertEqual (dist_agg_data .counts_per_bucket , counts_per_bucket )
@@ -339,16 +311,12 @@ def test_exemplar_int_attachment_value(self):
339311 def test_variance (self ):
340312 mean_data = mock .Mock ()
341313 count_data = 0
342- _min = mock .Mock ()
343- _max = mock .Mock ()
344314 sum_of_sqd_deviations = mock .Mock ()
345315 counts_per_bucket = [1 , 1 , 1 ]
346316 bounds = [1.0 / 2.0 , 1 ]
347317 dist_agg_data = aggregation_data_module .DistributionAggregationData (
348318 mean_data = mean_data ,
349319 count_data = count_data ,
350- min_ = _min ,
351- max_ = _max ,
352320 sum_of_sqd_deviations = sum_of_sqd_deviations ,
353321 counts_per_bucket = counts_per_bucket ,
354322 bounds = bounds )
@@ -359,8 +327,6 @@ def test_variance(self):
359327 dist_agg_data = aggregation_data_module .DistributionAggregationData (
360328 mean_data = mean_data ,
361329 count_data = count_data ,
362- min_ = _min ,
363- max_ = _max ,
364330 sum_of_sqd_deviations = sum_of_sqd_deviations ,
365331 counts_per_bucket = counts_per_bucket ,
366332 bounds = bounds )
@@ -369,8 +335,6 @@ def test_variance(self):
369335 def test_add_sample (self ):
370336 mean_data = 1.0
371337 count_data = 0
372- _min = 0
373- _max = 1
374338 sum_of_sqd_deviations = 2
375339 counts_per_bucket = [1 , 1 , 1 , 1 ]
376340 bounds = [0.5 , 1 , 1.5 ]
@@ -380,24 +344,18 @@ def test_add_sample(self):
380344 dist_agg_data = aggregation_data_module .DistributionAggregationData (
381345 mean_data = mean_data ,
382346 count_data = count_data ,
383- min_ = _min ,
384- max_ = _max ,
385347 sum_of_sqd_deviations = sum_of_sqd_deviations ,
386348 counts_per_bucket = counts_per_bucket ,
387349 bounds = bounds )
388350
389351 dist_agg_data .add_sample (value , None , None )
390- self .assertEqual (0 , dist_agg_data .min )
391- self .assertEqual (3 , dist_agg_data .max )
392352 self .assertEqual (1 , dist_agg_data .count_data )
393353 self .assertEqual (value , dist_agg_data .mean_data )
394354
395355 count_data = 1
396356 dist_agg_data = aggregation_data_module .DistributionAggregationData (
397357 mean_data = mean_data ,
398358 count_data = count_data ,
399- min_ = _min ,
400- max_ = _max ,
401359 sum_of_sqd_deviations = sum_of_sqd_deviations ,
402360 counts_per_bucket = counts_per_bucket ,
403361 bounds = bounds )
@@ -408,15 +366,9 @@ def test_add_sample(self):
408366 self .assertEqual (4.0 , dist_agg_data .sum_of_sqd_deviations )
409367 self .assertIsNot (0 , dist_agg_data .count_data )
410368
411- value_2 = - 1
412- dist_agg_data .add_sample (value_2 , None , None )
413- self .assertEqual (value_2 , dist_agg_data .min )
414-
415369 def test_add_sample_attachment (self ):
416370 mean_data = 1.0
417371 count_data = 1
418- _min = 0
419- _max = 1
420372 sum_of_sqd_deviations = 2
421373 counts_per_bucket = [1 , 1 , 1 , 1 ]
422374 bounds = [0.5 , 1 , 1.5 ]
@@ -430,8 +382,6 @@ def test_add_sample_attachment(self):
430382 dist_agg_data = aggregation_data_module .DistributionAggregationData (
431383 mean_data = mean_data ,
432384 count_data = count_data ,
433- min_ = _min ,
434- max_ = _max ,
435385 sum_of_sqd_deviations = sum_of_sqd_deviations ,
436386 counts_per_bucket = counts_per_bucket ,
437387 bounds = bounds ,
@@ -440,8 +390,6 @@ def test_add_sample_attachment(self):
440390 self .assertEqual (dist_agg_data .exemplars [3 ], exemplar_1 )
441391
442392 dist_agg_data .add_sample (value , timestamp , attachments )
443- self .assertEqual (0 , dist_agg_data .min )
444- self .assertEqual (3 , dist_agg_data .max )
445393 self .assertEqual (2 , dist_agg_data .count_data )
446394 self .assertEqual (2.0 , dist_agg_data .mean_data )
447395 # Check that adding a sample overwrites the bucket's exemplar
@@ -453,8 +401,6 @@ def test_add_sample_attachment(self):
453401 dist_agg_data = aggregation_data_module .DistributionAggregationData (
454402 mean_data = mean_data ,
455403 count_data = count_data ,
456- min_ = _min ,
457- max_ = _max ,
458404 sum_of_sqd_deviations = sum_of_sqd_deviations ,
459405 counts_per_bucket = [2 , 1 , 2 , 1 , 1 , 1 ],
460406 bounds = [1 , 2 , 3 , 4 , 5 ])
@@ -469,8 +415,6 @@ def test_add_sample_attachment(self):
469415 def test_increment_bucket_count (self ):
470416 mean_data = mock .Mock ()
471417 count_data = mock .Mock ()
472- _min = 0
473- _max = 1
474418 sum_of_sqd_deviations = mock .Mock ()
475419 counts_per_bucket = [0 ]
476420 bounds = []
@@ -480,8 +424,6 @@ def test_increment_bucket_count(self):
480424 dist_agg_data = aggregation_data_module .DistributionAggregationData (
481425 mean_data = mean_data ,
482426 count_data = count_data ,
483- min_ = _min ,
484- max_ = _max ,
485427 sum_of_sqd_deviations = sum_of_sqd_deviations ,
486428 counts_per_bucket = counts_per_bucket ,
487429 bounds = bounds )
@@ -495,8 +437,6 @@ def test_increment_bucket_count(self):
495437 dist_agg_data = aggregation_data_module .DistributionAggregationData (
496438 mean_data = mean_data ,
497439 count_data = count_data ,
498- min_ = _min ,
499- max_ = _max ,
500440 sum_of_sqd_deviations = sum_of_sqd_deviations ,
501441 counts_per_bucket = counts_per_bucket ,
502442 bounds = bounds )
@@ -509,8 +449,6 @@ def test_increment_bucket_count(self):
509449 dist_agg_data = aggregation_data_module .DistributionAggregationData (
510450 mean_data = mean_data ,
511451 count_data = count_data ,
512- min_ = _min ,
513- max_ = _max ,
514452 sum_of_sqd_deviations = sum_of_sqd_deviations ,
515453 counts_per_bucket = counts_per_bucket ,
516454 bounds = bounds )
@@ -529,8 +467,6 @@ def test_to_point(self):
529467 dist_agg_data = aggregation_data_module .DistributionAggregationData (
530468 mean_data = 50 ,
531469 count_data = 99 ,
532- min_ = 1 ,
533- max_ = 99 ,
534470 sum_of_sqd_deviations = 80850.0 ,
535471 counts_per_bucket = [0 , 9 , 90 , 0 ],
536472 bounds = [1 , 10 , 100 ],
@@ -561,8 +497,6 @@ def test_to_point_no_histogram(self):
561497 dist_agg_data = aggregation_data_module .DistributionAggregationData (
562498 mean_data = 50 ,
563499 count_data = 99 ,
564- min_ = 1 ,
565- max_ = 99 ,
566500 sum_of_sqd_deviations = 80850.0 ,
567501 )
568502 converted_point = dist_agg_data .to_point (timestamp )
0 commit comments