-
Notifications
You must be signed in to change notification settings - Fork 88
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
Conversation
}, | ||
}, | ||
}) | ||
// TODO |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
)
node_memory_XXX
=>node_memory_XXX_bytes
node_disk_XXX
=>node_disk_XXX_bytes
node_filesystem_XXX
=>node_filesystem_XXX_bytes