diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz.go b/vendor/github.com/prometheus/common/expfmt/fuzz.go index 14f920146..dc2eedeef 100644 --- a/vendor/github.com/prometheus/common/expfmt/fuzz.go +++ b/vendor/github.com/prometheus/common/expfmt/fuzz.go @@ -20,8 +20,8 @@ import "bytes" // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: // -// go-fuzz-build github.com/prometheus/client_golang/text -// go-fuzz -bin text-fuzz.zip -workdir fuzz +// go-fuzz-build github.com/prometheus/common/expfmt +// go-fuzz -bin expfmt-fuzz.zip -workdir fuzz // // Further input samples should go in the folder fuzz/corpus. func Fuzz(in []byte) int { diff --git a/vendor/github.com/prometheus/common/model/value.go b/vendor/github.com/prometheus/common/model/value.go index 10ffb0bd6..dbf5d10e4 100644 --- a/vendor/github.com/prometheus/common/model/value.go +++ b/vendor/github.com/prometheus/common/model/value.go @@ -16,6 +16,7 @@ package model import ( "encoding/json" "fmt" + "math" "sort" "strconv" "strings" @@ -43,8 +44,14 @@ func (v *SampleValue) UnmarshalJSON(b []byte) error { return nil } +// Equal returns true if the value of v and o is equal or if both are NaN. Note +// that v==o is false if both are NaN. If you want the conventional float +// behavior, use == to compare two SampleValues. func (v SampleValue) Equal(o SampleValue) bool { - return v == o + if v == o { + return true + } + return math.IsNaN(float64(v)) && math.IsNaN(float64(o)) } func (v SampleValue) String() string { @@ -77,9 +84,9 @@ func (s *SamplePair) UnmarshalJSON(b []byte) error { } // Equal returns true if this SamplePair and o have equal Values and equal -// Timestamps. +// Timestamps. The sematics of Value equality is defined by SampleValue.Equal. func (s *SamplePair) Equal(o *SamplePair) bool { - return s == o || (s.Value == o.Value && s.Timestamp.Equal(o.Timestamp)) + return s == o || (s.Value.Equal(o.Value) && s.Timestamp.Equal(o.Timestamp)) } func (s SamplePair) String() string { @@ -93,7 +100,8 @@ type Sample struct { Timestamp Time `json:"timestamp"` } -// Equal compares first the metrics, then the timestamp, then the value. +// Equal compares first the metrics, then the timestamp, then the value. The +// sematics of value equality is defined by SampleValue.Equal. func (s *Sample) Equal(o *Sample) bool { if s == o { return true @@ -105,7 +113,7 @@ func (s *Sample) Equal(o *Sample) bool { if !s.Timestamp.Equal(o.Timestamp) { return false } - if s.Value != o.Value { + if s.Value.Equal(o.Value) { return false } diff --git a/vendor/vendor.json b/vendor/vendor.json index 286f74f22..94a84800f 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -161,35 +161,40 @@ "revisionTime": "2015-02-12T10:17:44Z" }, { + "checksumSHA1": "l0JT1CAPc/22KdnxCke1LKtR+4M=", "path": "github.com/prometheus/common/expfmt", - "revision": "23070236b1ebff452f494ae831569545c2b61d26", - "revisionTime": "2016-02-11T16:03:55+01:00" + "revision": "c16e34897a744c32f6733ee720e60c4de13887fb", + "revisionTime": "2016-05-19T16:20:33Z" }, { + "checksumSHA1": "GWlM3d2vPYyNATtTFgftS10/A9w=", "path": "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg", - "revision": "4fdc91a58c9d3696b982e8a680f4997403132d44", - "revisionTime": "2015-10-26T12:04:34+01:00" + "revision": "c16e34897a744c32f6733ee720e60c4de13887fb", + "revisionTime": "2016-05-19T16:20:33Z" }, { + "checksumSHA1": "koBNYQryxAG8hyHBlpn8pcnSVdM=", "path": "github.com/prometheus/common/log", - "revision": "0a3005bb37bc411040083a55372e77c405f6464c", - "revisionTime": "2016-01-04T14:47:38+01:00" + "revision": "c16e34897a744c32f6733ee720e60c4de13887fb", + "revisionTime": "2016-05-19T16:20:33Z" }, { + "checksumSHA1": "Zgmg/aOfoCNTAMtrXqBJmt852t0=", "path": "github.com/prometheus/common/model", - "revision": "167b27da48d058a9b46d84b834d67f68f0243f67", - "revisionTime": "2016-03-18T12:23:18Z" + "revision": "c16e34897a744c32f6733ee720e60c4de13887fb", + "revisionTime": "2016-05-19T16:20:33Z" }, { + "checksumSHA1": "CKVJRc1NREmfoAWQLHxqWQlvxo0=", "path": "github.com/prometheus/common/route", - "revision": "14ca1097bbe21584194c15e391a9dab95ad42a59", - "revisionTime": "2016-01-25T23:57:51+01:00" + "revision": "c16e34897a744c32f6733ee720e60c4de13887fb", + "revisionTime": "2016-05-19T16:20:33Z" }, { "checksumSHA1": "91KYK0SpvkaMJJA2+BcxbVnyRO0=", "path": "github.com/prometheus/common/version", - "revision": "dd586c1c5abb0be59e60f942c22af711a2008cb4", - "revisionTime": "2016-05-03T22:05:32Z" + "revision": "c16e34897a744c32f6733ee720e60c4de13887fb", + "revisionTime": "2016-05-19T16:20:33Z" }, { "path": "github.com/prometheus/procfs",