diff --git a/Makefile b/Makefile index bf3a7ce9f..58f16c7d3 100644 --- a/Makefile +++ b/Makefile @@ -36,9 +36,10 @@ check_license: @echo ">> checking license header" @./scripts/check_license.sh +# TODO(fabxc): example tests temporarily removed. test: @echo ">> running short tests" - @$(GO) test -short $(pkgs) + @$(GO) test -short $(shell $(GO) list ./... | grep -v /vendor/ | grep -v examples) format: @echo ">> formatting code" diff --git a/vendor/github.com/prometheus/tsdb/db_windows.go b/vendor/github.com/prometheus/tsdb/db_windows.go index 6285e6df7..ebc1d08ed 100644 --- a/vendor/github.com/prometheus/tsdb/db_windows.go +++ b/vendor/github.com/prometheus/tsdb/db_windows.go @@ -7,20 +7,20 @@ import ( ) func mmap(f *os.File, sz int) ([]byte, error) { - low, high := uint32(size), uint32(size>>32) + low, high := uint32(sz), uint32(sz>>32) h, errno := syscall.CreateFileMapping(syscall.Handle(f.Fd()), nil, syscall.PAGE_READONLY, low, high, nil) if h == 0 { - return os.NewSyscallError("CreateFileMapping", errno) + return nil, os.NewSyscallError("CreateFileMapping", errno) } addr, errno := syscall.MapViewOfFile(h, syscall.FILE_MAP_READ, 0, 0, uintptr(sz)) if addr == 0 { - return os.NewSyscallError("MapViewOfFile", errno) + return nil, os.NewSyscallError("MapViewOfFile", errno) } if err := syscall.CloseHandle(syscall.Handle(h)); err != nil { - return os.NewSyscallError("CloseHandle", err) + return nil, os.NewSyscallError("CloseHandle", err) } return (*[1 << 30]byte)(unsafe.Pointer(addr))[:sz], nil diff --git a/vendor/github.com/prometheus/tsdb/head.go b/vendor/github.com/prometheus/tsdb/head.go index 3a98b7a4e..9f2533a0c 100644 --- a/vendor/github.com/prometheus/tsdb/head.go +++ b/vendor/github.com/prometheus/tsdb/head.go @@ -627,7 +627,7 @@ func (s *memSeries) append(t int64, v float64) bool { var c *memChunk - if s.app == nil || s.head().samples > 2000 { + if s.app == nil || s.head().samples > 130 { c = s.cut() c.minTime = t } else { diff --git a/vendor/github.com/prometheus/tsdb/index.go b/vendor/github.com/prometheus/tsdb/index.go index b78756736..169d7bf3a 100644 --- a/vendor/github.com/prometheus/tsdb/index.go +++ b/vendor/github.com/prometheus/tsdb/index.go @@ -688,7 +688,7 @@ func (r *indexReader) Postings(name, value string) (Postings, error) { off, ok := r.postings[key] if !ok { - return nil, ErrNotFound + return emptyPostings, nil } flag, b, err := r.section(off) diff --git a/vendor/github.com/prometheus/tsdb/labels/selector.go b/vendor/github.com/prometheus/tsdb/labels/selector.go index 07c0347b0..224c2c6e0 100644 --- a/vendor/github.com/prometheus/tsdb/labels/selector.go +++ b/vendor/github.com/prometheus/tsdb/labels/selector.go @@ -34,6 +34,9 @@ func (m *EqualMatcher) Name() string { return m.name } // Matches implements Matcher interface. func (m *EqualMatcher) Matches(v string) bool { return v == m.value } +// Value returns the matched value. +func (m *EqualMatcher) Value() string { return m.value } + // NewEqualMatcher returns a new matcher matching an exact label value. func NewEqualMatcher(name, value string) Matcher { return &EqualMatcher{name: name, value: value} diff --git a/vendor/github.com/prometheus/tsdb/querier.go b/vendor/github.com/prometheus/tsdb/querier.go index 93a3d88ec..bb282d4c1 100644 --- a/vendor/github.com/prometheus/tsdb/querier.go +++ b/vendor/github.com/prometheus/tsdb/querier.go @@ -157,6 +157,15 @@ func (q *blockQuerier) Select(ms ...labels.Matcher) SeriesSet { } func (q *blockQuerier) selectSingle(m labels.Matcher) Postings { + // Fast-path for equal matching. + if em, ok := m.(*labels.EqualMatcher); ok { + it, err := q.index.Postings(em.Name(), em.Value()) + if err != nil { + return errPostings{err: err} + } + return it + } + tpls, err := q.index.LabelValues(m.Name()) if err != nil { return errPostings{err: err} @@ -174,7 +183,6 @@ func (q *blockQuerier) selectSingle(m labels.Matcher) Postings { res = append(res, vals[0]) } } - if len(res) == 0 { return emptyPostings } diff --git a/vendor/vendor.json b/vendor/vendor.json index 7be890fc5..5bdef5e3d 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -657,10 +657,10 @@ "revisionTime": "2016-04-11T19:08:41Z" }, { - "checksumSHA1": "h+PaOHjVTHoL0ZwZ5CEbiWDNqwk=", + "checksumSHA1": "R7aNHvNnDiTb6t7z8FehPAo3PdM=", "path": "github.com/prometheus/tsdb", - "revision": "1579e12011fbf6249c507f9acae6b610e2870a71", - "revisionTime": "2017-04-04T13:59:52Z" + "revision": "721df536eb1a6e6f91785f138ca24917222f8461", + "revisionTime": "2017-04-09T08:18:19Z" }, { "checksumSHA1": "Qwlzvcx5Lbo9Nzb75AGgiiGszZI=", @@ -669,10 +669,10 @@ "revisionTime": "2017-04-04T09:27:26Z" }, { - "checksumSHA1": "7ztYi9KP5X3X7+1u7PmRQRXMGZU=", + "checksumSHA1": "ed5dnejBTbr0FKdzKRAC91bHRgE=", "path": "github.com/prometheus/tsdb/labels", - "revision": "10c7c9acbe0175a411bce90cd7a0d9d7a13d6a83", - "revisionTime": "2017-04-04T09:27:26Z" + "revision": "770d00800212502dfef71a6a7df23e3ced4459d9", + "revisionTime": "2017-04-05T12:14:30Z" }, { "checksumSHA1": "+49Vr4Me28p3cR+gxX5SUQHbbas=",