Skip to content

Commit

Permalink
Revert "change ExportMetric api to ExportMetricProto (census-ecosyste…
Browse files Browse the repository at this point in the history
…m#104)"

This reverts commit bf0d8a4.
  • Loading branch information
rghetia committed Mar 14, 2019
1 parent bf0d8a4 commit 77740c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion equivalence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func TestEquivalenceStatsVsMetricsUploads(t *testing.T) {

ma.forEachRequest(func(emr *agentmetricspb.ExportMetricsServiceRequest) {
for _, metric := range emr.Metrics {
_ = se.ExportMetricProto(context.Background(), emr.Node, emr.Resource, metric)
_ = se.ExportMetric(context.Background(), emr.Node, emr.Resource, metric)
}
})
se.Flush()
Expand Down
10 changes: 2 additions & 8 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,8 @@ type metricPayload struct {
metric *metricspb.Metric
}

// ExportMetric exports OpenCensus Metrics proto to Stackdriver Monitoring.
// Deprecated in lieu of ExportMetricProto
func (se *statsExporter) ExportMetric(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metricpb *metricspb.Metric) error {
return se.ExportMetricProto(ctx, node, rsc, metricpb)
}

// ExportMetricProto exports OpenCensus Metrics proto to Stackdriver Monitoring.
func (se *statsExporter) ExportMetricProto(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metric *metricspb.Metric) error {
// ExportMetric exports OpenCensus Metrics to Stackdriver Monitoring.
func (se *statsExporter) ExportMetric(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metric *metricspb.Metric) error {
if metric == nil {
return errNilMetric
}
Expand Down
8 changes: 1 addition & 7 deletions stackdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,9 @@ func (e *Exporter) ExportView(vd *view.Data) {
e.statsExporter.ExportView(vd)
}

// ExportMetricProto exports OpenCensus Metrics to Stackdriver Monitoring.
func (e *Exporter) ExportMetricProto(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metric *metricspb.Metric) error {
return e.statsExporter.ExportMetricProto(ctx, node, rsc, metric)
}

// ExportMetric exports OpenCensus Metrics to Stackdriver Monitoring.
// Deprecated in lieu of ExportMetriProto
func (e *Exporter) ExportMetric(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metric *metricspb.Metric) error {
return e.statsExporter.ExportMetricProto(ctx, node, rsc, metric)
return e.statsExporter.ExportMetric(ctx, node, rsc, metric)
}

// ExportSpan exports a SpanData to Stackdriver Trace.
Expand Down

0 comments on commit 77740c0

Please sign in to comment.