Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Pająk <[email protected]>
  • Loading branch information
codeboten and pellared authored Dec 4, 2024
1 parent 2d0d4a5 commit 4280aa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions sdk/metric/internal/x/x.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func (f Feature[T]) Enabled() bool {
return ok
}

// EnabledInstrument provides the interface for synchronous
// instruments to returned whether or not they are enabled.
// EnabledInstrument informs whether the instrument is enabled.
//
// EnabledInstrument interface is implemented by synchronous instruments.
type EnabledInstrument interface {
// Enabled returns whether the instrument has any measurements
// associated with it.
// Enabled returns whether the instrument will process measurements for the given context.
//
// This function can be used in places where measuring an instrument
// would result in computationally expensive operations.
Expand Down
2 changes: 1 addition & 1 deletion sdk/metric/meter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func TestMeterWithDropView(t *testing.T) {
ctr, err := m.Int64Counter("sint")
assert.NoError(t, err)
c, ok := ctr.(x.EnabledInstrument)
assert.True(t, ok)
require.True(t, ok)
assert.False(t, c.Enabled())
},
},
Expand Down

0 comments on commit 4280aa4

Please sign in to comment.