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:
Ben Kochie 2019-05-31 18:30:37 +02:00 committed by GitHub
commit 8146998945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 771 additions and 76 deletions

View file

@ -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)
}