From 2ccd3340df65b711de5f2ca599f27829517d0b80 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Tue, 28 Feb 2017 13:49:09 -0400 Subject: [PATCH 1/2] Add goreportcard to README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0be58655..0c4822f8 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,12 @@ [![CircleCI](https://circleci.com/gh/prometheus/node_exporter/tree/master.svg?style=shield)][circleci] [![Docker Repository on Quay](https://quay.io/repository/prometheus/node-exporter/status)][quay] [![Docker Pulls](https://img.shields.io/docker/pulls/prom/node-exporter.svg?maxAge=604800)][hub] +[![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/node_exporter)][goreportcard] Prometheus exporter for hardware and OS metrics exposed by \*NIX kernels, written in Go with pluggable metric collectors. -The [WMI exporter](https://github.com/martinlindhe/wmi_exporter) is recommended for Windows users. +The [WMI exporter](https://github.com/martinlindhe/wmi_exporter) is recommended for Windows users. ## Collectors @@ -135,3 +136,4 @@ Be aware though that the mountpoint label in various metrics will now have [hub]: https://hub.docker.com/r/prom/node-exporter/ [circleci]: https://circleci.com/gh/prometheus/node_exporter [quay]: https://quay.io/repository/prometheus/node-exporter +[goreportcard]: https://goreportcard.com/report/github.com/prometheus/node_exporter From abdebef47c4ab3d712de4d2170ee9a5ab99f6e6e Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Tue, 28 Feb 2017 13:50:45 -0400 Subject: [PATCH 2/2] Fix gofmt -s and spelling issues --- collector/mountstats_linux.go | 2 +- collector/nfs_linux.go | 6 +++--- collector/systemd_linux_test.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/collector/mountstats_linux.go b/collector/mountstats_linux.go index 6119124f..f90543f1 100644 --- a/collector/mountstats_linux.go +++ b/collector/mountstats_linux.go @@ -419,7 +419,7 @@ func NewMountStatsCollector() (Collector, error) { NFSEventVFSLockTotal: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "event_vfs_lock_total"), - "Number of times locking has been attemped on a file.", + "Number of times locking has been attempted on a file.", labels, nil, ), diff --git a/collector/nfs_linux.go b/collector/nfs_linux.go index 827c0cc7..c3168d57 100644 --- a/collector/nfs_linux.go +++ b/collector/nfs_linux.go @@ -31,20 +31,20 @@ var ( procLineRE = regexp.MustCompile(`^proc(\d+) \d+ (\d+( \d+)*)$`) nfsProcedures = map[string][]string{ - "2": []string{ + "2": { "null", "getattr", "setattr", "root", "lookup", "readlink", "read", "writecache", "write", "create", "remove", "rename", "link", "symlink", "mkdir", "rmdir", "readdir", "statfs", }, - "3": []string{ + "3": { "null", "getattr", "setattr", "lookup", "access", "readlink", "read", "write", "create", "mkdir", "symlink", "mknod", "remove", "rmdir", "rename", "link", "readdir", "readdirplus", "fsstat", "fsinfo", "pathconf", "commit", }, - "4": []string{ + "4": { "null", "read", "write", "commit", "open", "open_confirm", "open_noattr", "open_downgrade", "close", "setattr", "fsinfo", "renew", "setclientid", diff --git a/collector/systemd_linux_test.go b/collector/systemd_linux_test.go index 07e013a7..2d9bdf66 100644 --- a/collector/systemd_linux_test.go +++ b/collector/systemd_linux_test.go @@ -24,7 +24,7 @@ import ( // Creates mock UnitLists func getUnitListFixtures() [][]dbus.UnitStatus { fixture1 := []dbus.UnitStatus{ - dbus.UnitStatus{ + { Name: "foo", Description: "foo desc", LoadState: "loaded", @@ -36,7 +36,7 @@ func getUnitListFixtures() [][]dbus.UnitStatus { JobType: "", JobPath: "/", }, - dbus.UnitStatus{ + { Name: "bar", Description: "bar desc", LoadState: "not-found", @@ -48,7 +48,7 @@ func getUnitListFixtures() [][]dbus.UnitStatus { JobType: "", JobPath: "/", }, - dbus.UnitStatus{ + { Name: "foobar", Description: "bar desc", LoadState: "not-found", @@ -60,7 +60,7 @@ func getUnitListFixtures() [][]dbus.UnitStatus { JobType: "", JobPath: "/", }, - dbus.UnitStatus{ + { Name: "baz", Description: "bar desc", LoadState: "not-found",