Skip to content

Commit

Permalink
[receiver/riak] Enable lint and fix issues (#11802)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Jun 29, 2022
1 parent ce857ae commit c97ea64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions receiver/riakreceiver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// nolint:errcheck
package riakreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/riakreceiver"

import (
Expand Down Expand Up @@ -112,7 +111,8 @@ func TestGetStatsDetails(t *testing.T) {

// Setup test server
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write(data)
_, err := w.Write(data)
require.NoError(t, err)
}))
defer ts.Close()

Expand Down
13 changes: 6 additions & 7 deletions receiver/riakreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// nolint:gocritic
package riakreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/riakreceiver"

import (
Expand Down Expand Up @@ -77,25 +76,25 @@ func (r *riakScraper) scrape(ctx context.Context) (pmetric.Metrics, error) {
func (r *riakScraper) collectStats(stat *model.Stats) (pmetric.Metrics, error) {
now := pcommon.NewTimestampFromTime(time.Now())
var errors scrapererror.ScrapeErrors
//scrape node.operation.count metric
// scrape node.operation.count metric
r.mb.RecordRiakNodeOperationCountDataPoint(now, stat.NodeGets, metadata.AttributeRequestGet)
r.mb.RecordRiakNodeOperationCountDataPoint(now, stat.NodePuts, metadata.AttributeRequestPut)

//scrape node.operation.time.mean metric
// scrape node.operation.time.mean metric
r.mb.RecordRiakNodeOperationTimeMeanDataPoint(now, stat.NodeGetFsmTimeMean, metadata.AttributeRequestGet)
r.mb.RecordRiakNodeOperationTimeMeanDataPoint(now, stat.NodePutFsmTimeMean, metadata.AttributeRequestPut)

//scrape node.read_repair.count metric
// scrape node.read_repair.count metric
r.mb.RecordRiakNodeReadRepairCountDataPoint(now, stat.ReadRepairs)

//scrape node.memory.limit metric
// scrape node.memory.limit metric
r.mb.RecordRiakMemoryLimitDataPoint(now, stat.MemAllocated)

//scrape vnode.operation.count metric
// scrape vnode.operation.count metric
r.mb.RecordRiakVnodeOperationCountDataPoint(now, stat.VnodeGets, metadata.AttributeRequestGet)
r.mb.RecordRiakVnodeOperationCountDataPoint(now, stat.VnodePuts, metadata.AttributeRequestPut)

//scrape vnode.index.operation.count metric
// scrape vnode.index.operation.count metric
r.mb.RecordRiakVnodeIndexOperationCountDataPoint(now, stat.VnodeIndexReads, metadata.AttributeOperationRead)
r.mb.RecordRiakVnodeIndexOperationCountDataPoint(now, stat.VnodeIndexWrites, metadata.AttributeOperationWrite)
r.mb.RecordRiakVnodeIndexOperationCountDataPoint(now, stat.VnodeIndexDeletes, metadata.AttributeOperationDelete)
Expand Down

0 comments on commit c97ea64

Please sign in to comment.