@@ -968,6 +968,22 @@ def test_exponential_explicit_bucket_histogram(self):
968
968
ExplicitBucketHistogramAggregation ,
969
969
)
970
970
971
+ def test_preferred_aggregation_override (self ):
972
+
973
+ histogram_aggregation = ExplicitBucketHistogramAggregation (
974
+ boundaries = [0.05 , 0.1 , 0.5 , 1 , 5 , 10 ],
975
+ )
976
+
977
+ exporter = OTLPMetricExporter (
978
+ preferred_aggregation = {
979
+ Histogram : histogram_aggregation ,
980
+ },
981
+ )
982
+
983
+ self .assertEqual (
984
+ exporter ._preferred_aggregation [Histogram ], histogram_aggregation
985
+ )
986
+
971
987
972
988
def _resource_metrics (
973
989
index : int , scope_metrics : List [ScopeMetrics ]
@@ -1006,19 +1022,3 @@ def _number_data_point(value: int) -> NumberDataPoint:
1006
1022
time_unix_nano = 1641946016139533244 ,
1007
1023
value = value ,
1008
1024
)
1009
-
1010
- def test_preferred_aggregation_override (self ):
1011
-
1012
- histogram_aggregation = ExplicitBucketHistogramAggregation (
1013
- boundaries = [0.05 , 0.1 , 0.5 , 1 , 5 , 10 ],
1014
- )
1015
-
1016
- exporter = OTLPMetricExporter (
1017
- preferred_aggregation = {
1018
- Histogram : histogram_aggregation ,
1019
- },
1020
- )
1021
-
1022
- self .assertEqual (
1023
- exporter ._preferred_aggregation [Histogram ], histogram_aggregation
1024
- )
0 commit comments