Skip to content

Commit

Permalink
cpu: implement int32 counter for PDH calls as well.
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Nov 3, 2024
1 parent 0cffc69 commit bb2bdfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion internal/perfdata/perfdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var (
AllInstances = []string{"*"}
)

//nolint:ireturn
func NewCollector(engine Engine, object string, instances []string, counters []string) (Collector, error) {

Check failure on line 30 in internal/perfdata/perfdata.go

View workflow job for this annotation

GitHub Actions / lint

NewCollector returns interface (github.com/prometheus-community/windows_exporter/internal/perfdata.Collector) (ireturn)
switch engine {
case V1:
Expand Down
6 changes: 3 additions & 3 deletions internal/utils/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ func TestCounter(t *testing.T) {
t.Parallel()

c := utils.NewCounter(0)
assert.Equal(t, 0.0, c.Value())
assert.Equal(t, 0.0, c.Value()) //nolint:testifylint

c.AddValue(1)

assert.Equal(t, 1.0, c.Value())
assert.Equal(t, 1.0, c.Value()) //nolint:testifylint

c.AddValue(math.MaxUint32)

assert.Equal(t, float64(math.MaxUint32)+1.0, c.Value())
assert.Equal(t, float64(math.MaxUint32)+1.0, c.Value()) //nolint:testifylint
}

0 comments on commit bb2bdfb

Please sign in to comment.