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

PMM-5058 Update node_exporter-like metrics. #33

Merged
merged 4 commits into from
Dec 11, 2019
Merged

Conversation

AlekSi
Copy link

@AlekSi AlekSi commented Dec 10, 2019

  • node_memory_XXX => node_memory_XXX_bytes
  • node_disk_XXX => node_disk_XXX_bytes
  • node_filesystem_XXX => node_filesystem_XXX_bytes

@AlekSi AlekSi self-assigned this Dec 10, 2019
},
},
})
// TODO

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sessions/sessions_test.go:57: Line contains TODO/BUG/FIXME: "TODO" (from godox)

@@ -11,34 +14,53 @@ import (
)

//nolint:lll
func readJSON(t *testing.T, file string) []byte {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func readJSON is unused (from unused)

return bytes.TrimSpace(b)
}

func readMetrics(t *testing.T, file string) []string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func readMetrics is unused (from unused)


b, err := ioutil.ReadFile(filepath.Join("testdata", file)) //nolint:gosec
require.NoError(t, err)
return bytes.TrimSpace(b)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return statements should not be cuddled if block has more than two lines (from wsl)


b, err := ioutil.ReadFile(filepath.Join("testdata", file)) //nolint:gosec
require.NoError(t, err)
return strings.Split(string(bytes.TrimSpace(b)), "\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return statements should not be cuddled if block has more than two lines (from wsl)

m := prometheus.MustNewConstMetric(desc, prometheus.CounterValue, float64(*s.ReadKb*1024), labelValues...)
res = append(res, m)
}
if s.WriteKb != nil {
desc := prometheus.NewDesc("node_disk_bytes_written", "The total number of bytes written successfully.", labelKeys, constLabels)
desc := prometheus.NewDesc("node_disk_written_bytes_total", "The total number of bytes written successfully.", labelKeys, constLabels)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is 142 characters (from lll)

res = append(res, prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, float64((s.Total-s.Used)*1024), labelValues...))
desc = prometheus.NewDesc("node_filesystem_avail", "Filesystem space available to non-root users in bytes.", labelKeys, constLabels)
desc = prometheus.NewDesc("node_filesystem_avail_bytes", "Filesystem space available to non-root users in bytes.", labelKeys, constLabels)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line is 142 characters (from lll)

@@ -10,35 +14,51 @@ import (
"github.com/stretchr/testify/require"
)

//nolint:lll
var golden = flag.Bool("golden", false, "update golden files")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golden is a global variable (from gochecknoglobals)

@AlekSi AlekSi marked this pull request as ready for review December 11, 2019 12:00
@AlekSi AlekSi requested a review from BupycHuk December 11, 2019 12:00
@AlekSi AlekSi changed the title PMM-5058 Update node_memory_XXX metrics. PMM-5058 Update node_exporter-like metrics. Dec 11, 2019
@AlekSi AlekSi merged commit 03bab8a into master Dec 11, 2019
@AlekSi AlekSi deleted the PMM-5085-fix-metrics branch December 11, 2019 12:24
@BupycHuk BupycHuk mentioned this pull request Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants