Skip to content

Commit

Permalink
sync master (#1800)
Browse files Browse the repository at this point in the history
* Remove OpenTelemetry from the code (but leave redisotel as is) (#1782)

* Add XAutoClaim command (#1780)

* fix typo (#1788)

* xgroup/xadd/xtrim supports new options (#1787)

* support cmd option

XGROUP CREATECONSUMER
XTRIM MINID LIMIT
XADD NOMKSTREAM MINID LIMIT

Signed-off-by: monkey <golang@88.com>

* add XAddArgs.Approx doc

Signed-off-by: monkey92t <golang@88.com>

* Add Bun to readme

* Upgrade the <sorted set> series of commands (#1792)

* Upgrade the <sorted set> series of commands

Signed-off-by: monkey92t <golang@88.com>

* Cancel the Deprecated mark of ZAddNX and ZAddXX

Signed-off-by: monkey92t <golang@88.com>

* Explain the use restrictions of KeepTTL. (#1799)

Signed-off-by: monkey92t <golang@88.com>

* Adjust KeepTTL annotation.

Signed-off-by: monkey92t <golang@88.com>

* the hello command throws possible errors, It may affect the "read timeout" test result.

Signed-off-by: monkey92t <golang@88.com>

Co-authored-by: Vladimir Mihailenco <vladimir.webdev@gmail.com>
Co-authored-by: ericmillin <31105612+ericmillin@users.noreply.github.com>
Co-authored-by: heyanfu <1145291570@qq.com>
  • Loading branch information
4 people committed Jun 28, 2021
1 parent bd6402a commit 63df0e5
Show file tree
Hide file tree
Showing 13 changed files with 948 additions and 449 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,19 @@
> :heart:
> [**Uptrace.dev** - All-in-one tool to optimize performance and monitor errors & logs](https://uptrace.dev)
## v8.10

- Removed extra OpenTelemetry spans from go-redis core. Now go-redis instrumentation only adds a
single span with a Redis command (instead of 4 spans). There are multiple reasons behind this
decision:

- Traces become smaller and less noisy.
- It may be costly to process those 3 extra spans for each query.
- go-redis no longer depends on OpenTelemetry.

Eventually we hope to replace the information that we no longer collect with OpenTelemetry
Metrics.

## v8.9

- Changed `PubSub.Channel` to only rely on `Ping` result. You can now use `WithChannelSize`,
Expand Down
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -17,6 +17,9 @@
- [Examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples)
- [RealWorld example app](https://github.com/uptrace/go-treemux-realworld-example-app)

> :heart: Please check [Bun](https://bun.uptrace.dev) - fast and simple SQL client for PostgreSQL,
> MySQL, and SQLite.
## Ecosystem

- [Redis Mock](https://github.com/go-redis/redismock).
Expand Down Expand Up @@ -160,8 +163,3 @@ Lastly, run:
```
go test
```

## See also

- [Fast and flexible ORM](https://github.com/uptrace/bun)
- [msgpack for Go](https://github.com/vmihailenco/msgpack)
2 changes: 1 addition & 1 deletion bench_test.go
Expand Up @@ -222,7 +222,7 @@ func BenchmarkZAdd(b *testing.B) {

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
err := client.ZAdd(ctx, "key", &redis.Z{
err := client.ZAdd(ctx, "key", redis.Z{
Score: float64(1),
Member: "hello",
}).Err()
Expand Down
106 changes: 106 additions & 0 deletions command.go
Expand Up @@ -1509,6 +1509,112 @@ func (cmd *XPendingExtCmd) readReply(rd *proto.Reader) error {

//------------------------------------------------------------------------------

type XAutoClaimCmd struct {
baseCmd

start string
val []XMessage
}

var _ Cmder = (*XAutoClaimCmd)(nil)

func NewXAutoClaimCmd(ctx context.Context, args ...interface{}) *XAutoClaimCmd {
return &XAutoClaimCmd{
baseCmd: baseCmd{
ctx: ctx,
args: args,
},
}
}

func (cmd *XAutoClaimCmd) Val() (messages []XMessage, start string) {
return cmd.val, cmd.start
}

func (cmd *XAutoClaimCmd) Result() (messages []XMessage, start string, err error) {
return cmd.val, cmd.start, cmd.err
}

func (cmd *XAutoClaimCmd) String() string {
return cmdString(cmd, cmd.val)
}

func (cmd *XAutoClaimCmd) readReply(rd *proto.Reader) error {
var err error
if err = rd.ReadFixedArrayLen(2); err != nil {
return err
}

cmd.start, err = rd.ReadString()
if err != nil {
return err
}
cmd.val, err = readXMessageSlice(rd)
if err != nil {
return err
}
return nil
}

//------------------------------------------------------------------------------

type XAutoClaimJustIDCmd struct {
baseCmd

start string
val []string
}

var _ Cmder = (*XAutoClaimJustIDCmd)(nil)

func NewXAutoClaimJustIDCmd(ctx context.Context, args ...interface{}) *XAutoClaimJustIDCmd {
return &XAutoClaimJustIDCmd{
baseCmd: baseCmd{
ctx: ctx,
args: args,
},
}
}

func (cmd *XAutoClaimJustIDCmd) Val() (ids []string, start string) {
return cmd.val, cmd.start
}

func (cmd *XAutoClaimJustIDCmd) Result() (ids []string, start string, err error) {
return cmd.val, cmd.start, cmd.err
}

func (cmd *XAutoClaimJustIDCmd) String() string {
return cmdString(cmd, cmd.val)
}

func (cmd *XAutoClaimJustIDCmd) readReply(rd *proto.Reader) error {
var err error
if err = rd.ReadFixedArrayLen(2); err != nil {
return err
}

cmd.start, err = rd.ReadString()
if err != nil {
return err
}
n, err := rd.ReadArrayLen()
if err != nil {
return err
}

cmd.val = make([]string, n)
for i := 0; i < n; i++ {
cmd.val[i], err = rd.ReadString()
if err != nil {
return err
}
}
return nil
}

//------------------------------------------------------------------------------

type XInfoConsumersCmd struct {
baseCmd
val []XInfoConsumer
Expand Down

0 comments on commit 63df0e5

Please sign in to comment.