Skip to content

Commit

Permalink
Merge pull request #81 from go-faster/dependabot/go_modules/github.co…
Browse files Browse the repository at this point in the history
…m/ogen-go/ogen-0.72.0

build(deps): bump github.com/ogen-go/ogen from 0.71.1 to 0.72.0
  • Loading branch information
ernado authored Jul 29, 2023
2 parents 49cda1a + 708bbdd commit 7713902
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 35 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/go-faster/tcpproxy v0.1.0
github.com/go-logfmt/logfmt v0.6.0
github.com/google/uuid v1.3.0
github.com/ogen-go/ogen v0.71.1
github.com/ogen-go/ogen v0.72.0
github.com/opentracing/opentracing-go v1.2.0
github.com/prometheus/common v0.44.0
github.com/prometheus/prometheus v0.46.0
Expand Down Expand Up @@ -45,7 +45,7 @@ require (
go.ytsaurus.tech/library/go/core/log v0.0.3
go.ytsaurus.tech/yt/go v0.0.7
go4.org/netipx v0.0.0-20230303233057-f1b76eb4bb35
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090
golang.org/x/sync v0.3.0
golang.org/x/tools v0.11.0
google.golang.org/grpc v1.57.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/ogen-go/ogen v0.71.1 h1:X/TYjyi5XkXpuvLCRQYbPF/T4VJ/bjBNjdcW8ZW+NK0=
github.com/ogen-go/ogen v0.71.1/go.mod h1:DN3Tv8Zqla1f0JYUANyR7aEb9sRHwIwrxguv0pzVH6o=
github.com/ogen-go/ogen v0.72.0 h1:BmwbInSq2DRStoaEgF9od1da5bq1q+viZlwPS6qXQ1c=
github.com/ogen-go/ogen v0.72.0/go.mod h1:2SgZ9FRMXsuUhdTq23nFBFgMaXQl6yennmAnIs+hofM=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
Expand Down Expand Up @@ -643,8 +643,8 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw=
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down
16 changes: 16 additions & 0 deletions internal/cmp/cmp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Package cmp is a simple utility package for comparing values.
package cmp

import "golang.org/x/exp/constraints"

// Compare is a comparator.
func Compare[T constraints.Ordered](a, b T) int {
switch {
case a < b:
return -1
case a > b:
return 1
default:
return 0
}
}
3 changes: 2 additions & 1 deletion internal/logql/logqlengine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"go.opentelemetry.io/collector/pdata/pcommon"
"golang.org/x/exp/slices"

"github.com/go-faster/oteldb/internal/cmp"
"github.com/go-faster/oteldb/internal/iterators"
"github.com/go-faster/oteldb/internal/logql"
"github.com/go-faster/oteldb/internal/logstorage"
Expand Down Expand Up @@ -339,7 +340,7 @@ func TestEngineEvalStream(t *testing.T) {
})
}
}
slices.SortFunc(entries, func(a, b entry) bool { return a.ts < b.ts })
slices.SortFunc(entries, func(a, b entry) int { return cmp.Compare(a.ts, b.ts) })

assert.Len(t, entries, len(tt.wantData))
for i, e := range entries {
Expand Down
8 changes: 5 additions & 3 deletions internal/logql/logqlengine/logqlmetric/prom_math.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"math"

"golang.org/x/exp/slices"

"github.com/go-faster/oteldb/internal/cmp"
)

// Note: this file contains stats functions from Prometheus.
Expand All @@ -25,11 +27,11 @@ func quantile(q float64, values []FPoint) float64 {
if q > 1 {
return math.Inf(+1)
}
slices.SortFunc(values, func(a, b FPoint) bool {
slices.SortFunc(values, func(a, b FPoint) int {
if math.IsNaN(a.Value) {
return true
return -1
}
return a.Value < b.Value
return cmp.Compare(a.Value, b.Value)
})

n := float64(len(values))
Expand Down
9 changes: 5 additions & 4 deletions internal/logql/logqlengine/logqlmetric/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ import (
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"

"github.com/go-faster/oteldb/internal/cmp"
"github.com/go-faster/oteldb/internal/iterators"
"github.com/go-faster/oteldb/internal/logql"
"github.com/go-faster/oteldb/internal/lokiapi"
)

func testSampler(samples []SampledEntry) SampleSelector {
return func(_ *logql.RangeAggregationExpr, _, _ time.Time) (iterators.Iterator[SampledEntry], error) {
slices.SortStableFunc(samples, func(a, b SampledEntry) bool {
return a.Timestamp < b.Timestamp
slices.SortStableFunc(samples, func(a, b SampledEntry) int {
return cmp.Compare(a.Timestamp, b.Timestamp)
})
return iterators.Slice(samples), nil
}
Expand Down Expand Up @@ -489,10 +490,10 @@ func TestGroupedAggregation(t *testing.T) {
}
got = append(got, to)
}
slices.SortFunc(got, func(a, b series) bool {
slices.SortFunc(got, func(a, b series) int {
akey := a.labels["foo"] + a.labels["method"]
bkey := b.labels["foo"] + b.labels["method"]
return akey < bkey
return cmp.Compare(akey, bkey)
})
require.Equal(t, tt.expected, got)
})
Expand Down
7 changes: 6 additions & 1 deletion internal/logql/logqlengine/logqlmetric/vector_agg.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ func (i *vectorAggHeapIterator) Next(r *Step) bool {
r.Samples = r.Samples[:0]
for _, g := range result {
samples := g.heap.elements
slices.SortFunc(samples, i.less)
slices.SortFunc(samples, func(a, b Sample) int {
if i.less(a, b) {
return -1
}
return 0
})
r.Samples = append(r.Samples, samples...)
}

Expand Down
14 changes: 6 additions & 8 deletions internal/lokiapi/oas_json_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions internal/promapi/oas_json_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions internal/tempoapi/oas_json_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7713902

Please sign in to comment.