Fix rollover bug in mountstats collector (#1364)
* Update procfs vendor to pull in github.com/prometheus/procfs/pull/165 * Update mountstats collector to use new types. * Rollover counter automatically to avoid float64 accuracy issues. * Update e2e test. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
501ccf9fb4
commit
8146998945
21 changed files with 771 additions and 76 deletions
4
vendor/github.com/prometheus/procfs/nfs/parse.go
generated
vendored
4
vendor/github.com/prometheus/procfs/nfs/parse.go
generated
vendored
|
|
@ -118,7 +118,7 @@ func parseClientRPC(v []uint64) (ClientRPC, error) {
|
|||
|
||||
func parseV2Stats(v []uint64) (V2Stats, error) {
|
||||
values := int(v[0])
|
||||
if len(v[1:]) != values || values != 18 {
|
||||
if len(v[1:]) != values || values < 18 {
|
||||
return V2Stats{}, fmt.Errorf("invalid V2Stats line %q", v)
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ func parseV2Stats(v []uint64) (V2Stats, error) {
|
|||
|
||||
func parseV3Stats(v []uint64) (V3Stats, error) {
|
||||
values := int(v[0])
|
||||
if len(v[1:]) != values || values != 22 {
|
||||
if len(v[1:]) != values || values < 22 {
|
||||
return V3Stats{}, fmt.Errorf("invalid V3Stats line %q", v)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue