Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references in godoc comments to WithKeys #672

Merged
merged 3 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 10 additions & 28 deletions api/metric/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,15 @@ type BoundInt64Counter struct {
syncBoundInstrument
}

// Bind creates a bound instrument for this counter. The labels should
// contain the keys and values for each key specified in the counter
// with the WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// counter with the WithKeys option, then the missing value will be
// treated as unspecified.
// Bind creates a bound instrument for this counter. The labels are
// associated with values recorded via subsequent calls to Record.
func (c Float64Counter) Bind(labels ...core.KeyValue) (h BoundFloat64Counter) {
h.syncBoundInstrument = c.bind(labels)
return
}

// Bind creates a bound instrument for this counter. The labels should
// contain the keys and values for each key specified in the counter
// with the WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// counter with the WithKeys option, then the missing value will be
// treated as unspecified.
// Bind creates a bound instrument for this counter. The labels are
// associated with values recorded via subsequent calls to Record.
func (c Int64Counter) Bind(labels ...core.KeyValue) (h BoundInt64Counter) {
h.syncBoundInstrument = c.bind(labels)
return
Expand All @@ -81,33 +71,25 @@ func (c Int64Counter) Measurement(value int64) Measurement {
}

// Add adds the value to the counter's sum. The labels should contain
// the keys and values for each key specified in the counter with the
// WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// counter with the WithKeys option, then the missing value will be
// treated as unspecified.
// the keys and values to be associated with this value.
func (c Float64Counter) Add(ctx context.Context, value float64, labels ...core.KeyValue) {
c.directRecord(ctx, core.NewFloat64Number(value), labels)
}

// Add adds the value to the counter's sum. The labels should contain
// the keys and values for each key specified in the counter with the
// WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// counter with the WithKeys option, then the missing value will be
// treated as unspecified.
// the keys and values to be associated with this value.
func (c Int64Counter) Add(ctx context.Context, value int64, labels ...core.KeyValue) {
c.directRecord(ctx, core.NewInt64Number(value), labels)
}

// Add adds the value to the counter's sum.
// Add adds the value to the counter's sum using the labels
// previously bound to this counter via Bind()
func (b BoundFloat64Counter) Add(ctx context.Context, value float64) {
b.directRecord(ctx, core.NewFloat64Number(value))
}

// Add adds the value to the counter's sum.
// Add adds the value to the counter's sum using the labels
// previously bound to this counter via Bind()
func (b BoundInt64Counter) Add(ctx context.Context, value int64) {
b.directRecord(ctx, core.NewInt64Number(value))
}
40 changes: 12 additions & 28 deletions api/metric/measure.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,15 @@ type BoundInt64Measure struct {
syncBoundInstrument
}

// Bind creates a bound instrument for this measure. The labels should
// contain the keys and values for each key specified in the measure
// with the WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// measure with the WithKeys option, then the missing value will be
// treated as unspecified.
// Bind creates a bound instrument for this counter. The labels are
evantorrie marked this conversation as resolved.
Show resolved Hide resolved
// associated with values recorded via subsequent calls to Record.
func (c Float64Measure) Bind(labels ...core.KeyValue) (h BoundFloat64Measure) {
h.syncBoundInstrument = c.bind(labels)
return
}

// Bind creates a bound instrument for this measure. The labels should
// contain the keys and values for each key specified in the measure
// with the WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// measure with the WithKeys option, then the missing value will be
// treated as unspecified.
// Bind creates a bound instrument for this counter. The labels are
evantorrie marked this conversation as resolved.
Show resolved Hide resolved
// associated with values recorded via subsequent calls to Record.
func (c Int64Measure) Bind(labels ...core.KeyValue) (h BoundInt64Measure) {
h.syncBoundInstrument = c.bind(labels)
return
Expand All @@ -81,33 +71,27 @@ func (c Int64Measure) Measurement(value int64) Measurement {
}

// Record adds a new value to the list of measure's records. The
// labels should contain the keys and values for each key specified in
// the measure with the WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// measure with the WithKeys option, then the missing value will be
// treated as unspecified.
// labels should contain the keys and values to be associated with
// this value.
func (c Float64Measure) Record(ctx context.Context, value float64, labels ...core.KeyValue) {
c.directRecord(ctx, core.NewFloat64Number(value), labels)
}

// Record adds a new value to the list of measure's records. The
// labels should contain the keys and values for each key specified in
// the measure with the WithKeys option.
//
// If the labels do not contain a value for the key specified in the
// measure with the WithKeys option, then the missing value will be
// treated as unspecified.
// labels should contain the keys and values to be associated with
// this value.
func (c Int64Measure) Record(ctx context.Context, value int64, labels ...core.KeyValue) {
c.directRecord(ctx, core.NewInt64Number(value), labels)
}

// Record adds a new value to the list of measure's records.
// Record adds a new value to the list of measure's records using the labels
// previously bound to the measure via Bind()
func (b BoundFloat64Measure) Record(ctx context.Context, value float64) {
b.directRecord(ctx, core.NewFloat64Number(value))
}

// Record adds a new value to the list of measure's records.
// Record adds a new value to the list of measure's records using the labels
// previously bound to the measure via Bind()
func (b BoundInt64Measure) Record(ctx context.Context, value int64) {
b.directRecord(ctx, core.NewInt64Number(value))
}