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

Commit 19b4106

Browse files
author
Ramon Nogueira
authored
Update gRPC measures and views from spec (#689)
* Update gRPC measures and views from spec * Increase wait time after AppVeyor suprious failure TestCumulativenessFromHistograms failed on AppVeyor. Looks likely to be timing related. Without rewriting the test to avoid timing issues, I am just increasing the wait times in the hopes that this will resolve the issue. * Replace stats.UnitNone with stats.UnitDimensionless. * Add benchmark to test if map-based statusCodeToString is better Fixes: #687
1 parent 8a3b995 commit 19b4106

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

exporter/stackdriver/stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func (e *statsExporter) createMeasure(ctx context.Context, vd *view.Data) error
243243
valueType = metricpb.MetricDescriptor_INT64
244244
// If the aggregation type is count, which counts the number of recorded measurements, the unit must be "1",
245245
// because this view does not apply to the recorded values.
246-
unit = stats.UnitNone
246+
unit = stats.UnitDimensionless
247247
case view.AggTypeSum:
248248
switch m.(type) {
249249
case *stats.Int64Measure:

exporter/stackdriver/stats_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,13 @@ func TestExporter_createMeasure_CountAggregation(t *testing.T) {
685685
if got, want := mdr.MetricDescriptor.DisplayName, "OpenCensus/test_view_count"; got != want {
686686
t.Errorf("MetricDescriptor.DisplayName = %q; want %q", got, want)
687687
}
688-
if got, want := mdr.MetricDescriptor.Unit, stats.UnitNone; got != want {
688+
if got, want := mdr.MetricDescriptor.Unit, stats.UnitDimensionless; got != want {
689689
t.Errorf("MetricDescriptor.Unit = %q; want %q", got, want)
690690
}
691691
return &metric.MetricDescriptor{
692692
DisplayName: "OpenCensus/test_view_sum",
693693
Description: "view_description",
694-
Unit: stats.UnitNone,
694+
Unit: stats.UnitDimensionless,
695695
Type: "custom.googleapis.com/opencensus/test_view_count",
696696
MetricKind: metricpb.MetricDescriptor_CUMULATIVE,
697697
ValueType: metricpb.MetricDescriptor_INT64,

0 commit comments

Comments
 (0)