Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
add test to handle multiple timeseries for Summary metrics. (#220)
Browse files Browse the repository at this point in the history
- tests the fix for #214.
  • Loading branch information
rghetia authored and bogdandrutu committed Sep 16, 2019
1 parent 7ea215e commit 717ac5c
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions metrics_proto_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@ func TestExportMetricOfDifferentType(t *testing.T) {
LabelValues: []*metricspb.LabelValue{inEmptyValue, inOperTypeValue1},
Points: []*metricspb.Point{inPointsSummary},
},
// Add another time series to test https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/pull/214
{
StartTimestamp: startTimestamp,
LabelValues: []*metricspb.LabelValue{inEmptyValue, inOperTypeValue2},
Points: []*metricspb.Point{inPointsSummary},
},
},
},
},
Expand Down Expand Up @@ -606,6 +612,88 @@ func TestExportMetricOfDifferentType(t *testing.T) {
ValueType: googlemetricpb.MetricDescriptor_DOUBLE,
Points: []*monitoringpb.Point{outPointSummaryPercentile4},
},
{
Metric: &googlemetricpb.Metric{
Type: outMDSummarySum.Type,
Labels: map[string]string{
"empty_key": "",
"operation_type": "test_2",
},
},
Resource: outGlobalResource,
MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE,
ValueType: googlemetricpb.MetricDescriptor_DOUBLE,
Points: []*monitoringpb.Point{outPointSummarySum},
},
{
Metric: &googlemetricpb.Metric{
Type: outMDSummaryCount.Type,
Labels: map[string]string{
"empty_key": "",
"operation_type": "test_2",
},
},
Resource: outGlobalResource,
MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE,
ValueType: googlemetricpb.MetricDescriptor_INT64,
Points: []*monitoringpb.Point{outPointSummaryCount},
},
{
Metric: &googlemetricpb.Metric{
Type: outMDSummaryPercentile.Type,
Labels: map[string]string{
"percentile": "10.000000",
"empty_key": "",
"operation_type": "test_2",
},
},
Resource: outGlobalResource,
MetricKind: googlemetricpb.MetricDescriptor_GAUGE,
ValueType: googlemetricpb.MetricDescriptor_DOUBLE,
Points: []*monitoringpb.Point{outPointSummaryPercentile1},
},
{
Metric: &googlemetricpb.Metric{
Type: outMDSummaryPercentile.Type,
Labels: map[string]string{
"percentile": "50.000000",
"empty_key": "",
"operation_type": "test_2",
},
},
Resource: outGlobalResource,
MetricKind: googlemetricpb.MetricDescriptor_GAUGE,
ValueType: googlemetricpb.MetricDescriptor_DOUBLE,
Points: []*monitoringpb.Point{outPointSummaryPercentile2},
},
{
Metric: &googlemetricpb.Metric{
Type: outMDSummaryPercentile.Type,
Labels: map[string]string{
"percentile": "90.000000",
"empty_key": "",
"operation_type": "test_2",
},
},
Resource: outGlobalResource,
MetricKind: googlemetricpb.MetricDescriptor_GAUGE,
ValueType: googlemetricpb.MetricDescriptor_DOUBLE,
Points: []*monitoringpb.Point{outPointSummaryPercentile3},
},
{
Metric: &googlemetricpb.Metric{
Type: outMDSummaryPercentile.Type,
Labels: map[string]string{
"percentile": "99.000000",
"empty_key": "",
"operation_type": "test_2",
},
},
Resource: outGlobalResource,
MetricKind: googlemetricpb.MetricDescriptor_GAUGE,
ValueType: googlemetricpb.MetricDescriptor_DOUBLE,
Points: []*monitoringpb.Point{outPointSummaryPercentile4},
},
},
},
},
Expand Down

0 comments on commit 717ac5c

Please sign in to comment.