@@ -225,9 +225,9 @@ func TestNoGroupingExport(t *testing.T) {
225
225
)
226
226
}
227
227
228
- func TestHistogramMetricGroupingExport (t * testing.T ) {
228
+ func TestHistogramInt64MetricGroupingExport (t * testing.T ) {
229
229
r := record (
230
- "histogram" ,
230
+ "int64- histogram" ,
231
231
sdkapi .HistogramInstrumentKind ,
232
232
number .Int64Kind ,
233
233
append (baseKeyValues , cpuKey .Int (1 )),
@@ -240,7 +240,7 @@ func TestHistogramMetricGroupingExport(t *testing.T) {
240
240
{
241
241
Metrics : []* metricpb.Metric {
242
242
{
243
- Name : "histogram" ,
243
+ Name : "int64- histogram" ,
244
244
Data : & metricpb.Metric_Histogram {
245
245
Histogram : & metricpb.Histogram {
246
246
AggregationTemporality : metricpb .AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE ,
@@ -275,6 +275,56 @@ func TestHistogramMetricGroupingExport(t *testing.T) {
275
275
runMetricExportTests (t , nil , resource .Empty (), []testRecord {r , r }, expected )
276
276
}
277
277
278
+ func TestHistogramFloat64MetricGroupingExport (t * testing.T ) {
279
+ r := record (
280
+ "float64-histogram" ,
281
+ sdkapi .HistogramInstrumentKind ,
282
+ number .Float64Kind ,
283
+ append (baseKeyValues , cpuKey .Int (1 )),
284
+ testLibName ,
285
+ )
286
+ expected := []* metricpb.ResourceMetrics {
287
+ {
288
+ Resource : nil ,
289
+ InstrumentationLibraryMetrics : []* metricpb.InstrumentationLibraryMetrics {
290
+ {
291
+ Metrics : []* metricpb.Metric {
292
+ {
293
+ Name : "float64-histogram" ,
294
+ Data : & metricpb.Metric_Histogram {
295
+ Histogram : & metricpb.Histogram {
296
+ AggregationTemporality : metricpb .AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE ,
297
+ DataPoints : []* metricpb.HistogramDataPoint {
298
+ {
299
+ Attributes : cpu1Labels ,
300
+ StartTimeUnixNano : startTime (),
301
+ TimeUnixNano : pointTime (),
302
+ Count : 2 ,
303
+ Sum : 11.0 ,
304
+ ExplicitBounds : testHistogramBoundaries ,
305
+ BucketCounts : []uint64 {1 , 0 , 0 , 1 },
306
+ },
307
+ {
308
+ Attributes : cpu1Labels ,
309
+ Count : 2 ,
310
+ Sum : 11.0 ,
311
+ ExplicitBounds : testHistogramBoundaries ,
312
+ BucketCounts : []uint64 {1 , 0 , 0 , 1 },
313
+ StartTimeUnixNano : startTime (),
314
+ TimeUnixNano : pointTime (),
315
+ },
316
+ },
317
+ },
318
+ },
319
+ },
320
+ },
321
+ },
322
+ },
323
+ },
324
+ }
325
+ runMetricExportTests (t , nil , resource .Empty (), []testRecord {r , r }, expected )
326
+ }
327
+
278
328
func TestCountInt64MetricGroupingExport (t * testing.T ) {
279
329
r := record (
280
330
"int64-count" ,
0 commit comments