mirror of
https://github.com/prometheus/prometheus
synced 2024-12-27 00:53:12 +00:00
commit
34ca0bb20a
@ -1,3 +1,9 @@
|
||||
## 2.25.1 / 2021-03-14
|
||||
|
||||
* [BUGFIX] Fix a crash in `promtool` when a subquery with default resolution is used. #8569
|
||||
* [BUGFIX] Fix a bug that could return duplicate datapoints in queries. #8591
|
||||
* [BUGFIX] Fix crashes with arm64 when compiled with go1.16. #8593
|
||||
|
||||
## 2.25.0 / 2021-02-17
|
||||
|
||||
This release includes a new `--enable-feature=` flag that enables
|
||||
|
4
cmd/promtool/testdata/rules.yml
vendored
4
cmd/promtool/testdata/rules.yml
vendored
@ -20,3 +20,7 @@ groups:
|
||||
# A recording rule that doesn't depend on input series.
|
||||
- record: fixed_data
|
||||
expr: 1
|
||||
|
||||
# Subquery with default resolution test.
|
||||
- record: suquery_interval_test
|
||||
expr: count_over_time(up[5m:])
|
||||
|
@ -157,6 +157,7 @@ func (tg *testGroup) test(evalInterval time.Duration, groupOrderMap map[string]i
|
||||
return []error{err}
|
||||
}
|
||||
defer suite.Close()
|
||||
suite.SubqueryInterval = evalInterval
|
||||
|
||||
// Load the rule files.
|
||||
opts := &rules.ManagerOptions{
|
||||
|
@ -22,8 +22,7 @@ You can use `promtool` to test your rules.
|
||||
rule_files:
|
||||
[ - <file_name> ]
|
||||
|
||||
# optional, default = 1m
|
||||
evaluation_interval: <duration>
|
||||
[ evaluation_interval: <duration> | default = 1m ]
|
||||
|
||||
# The order in which group names are listed below will be the order of evaluation of
|
||||
# rule groups (at a given evaluation time). The order is guaranteed only for the groups mentioned below.
|
||||
|
2
go.mod
2
go.mod
@ -25,7 +25,7 @@ require (
|
||||
github.com/go-openapi/strfmt v0.20.0
|
||||
github.com/go-openapi/validate v0.20.2 // indirect
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang/snappy v0.0.2
|
||||
github.com/golang/snappy v0.0.3
|
||||
github.com/google/pprof v0.0.0-20210208152844-1612e9be7af6
|
||||
github.com/gophercloud/gophercloud v0.15.0
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||
|
4
go.sum
4
go.sum
@ -390,8 +390,8 @@ github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw=
|
||||
github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
|
@ -657,7 +657,8 @@ type LazyLoader struct {
|
||||
|
||||
loadCmd *loadCmd
|
||||
|
||||
storage storage.Storage
|
||||
storage storage.Storage
|
||||
SubqueryInterval time.Duration
|
||||
|
||||
queryEngine *Engine
|
||||
context context.Context
|
||||
@ -710,11 +711,12 @@ func (ll *LazyLoader) clear() {
|
||||
ll.storage = teststorage.New(ll)
|
||||
|
||||
opts := EngineOpts{
|
||||
Logger: nil,
|
||||
Reg: nil,
|
||||
MaxSamples: 10000,
|
||||
Timeout: 100 * time.Second,
|
||||
EnableAtModifier: true,
|
||||
Logger: nil,
|
||||
Reg: nil,
|
||||
MaxSamples: 10000,
|
||||
Timeout: 100 * time.Second,
|
||||
NoStepSubqueryIntervalFn: func(int64) int64 { return durationMilliseconds(ll.SubqueryInterval) },
|
||||
EnableAtModifier: true,
|
||||
}
|
||||
|
||||
ll.queryEngine = NewEngine(opts)
|
||||
|
@ -467,6 +467,7 @@ func (c *chainSampleIterator) Seek(t int64) bool {
|
||||
}
|
||||
if len(c.h) > 0 {
|
||||
c.curr = heap.Pop(&c.h).(chunkenc.Iterator)
|
||||
c.lastt, _ = c.curr.At()
|
||||
return true
|
||||
}
|
||||
c.curr = nil
|
||||
|
@ -647,6 +647,14 @@ func TestChainSampleIteratorSeek(t *testing.T) {
|
||||
seek: 2,
|
||||
expected: []tsdbutil.Sample{sample{2, 2}, sample{3, 3}, sample{4, 4}, sample{5, 5}},
|
||||
},
|
||||
{
|
||||
input: []chunkenc.Iterator{
|
||||
NewListSeriesIterator(samples{sample{0, 0}, sample{2, 2}, sample{3, 3}}),
|
||||
NewListSeriesIterator(samples{sample{0, 0}, sample{1, 1}, sample{2, 2}}),
|
||||
},
|
||||
seek: 0,
|
||||
expected: []tsdbutil.Sample{sample{0, 0}, sample{1, 1}, sample{2, 2}, sample{3, 3}},
|
||||
},
|
||||
} {
|
||||
merged := newChainSampleIterator(tc.input)
|
||||
actual := []tsdbutil.Sample{}
|
||||
|
Loading…
Reference in New Issue
Block a user