Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for go-redis/v8 #507

Merged
merged 26 commits into from
Oct 26, 2022
Merged

Conversation

papa-hexuan
Copy link
Contributor

Describe what this PR does / why we need it

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@papa-hexuan
Copy link
Contributor Author

sum(client_stats_gauge{job="appname" ,type="redis",index="idle_conns"})by(name)
sum(client_stats_gauge{job="appname" ,type="redis",index="stale_conns"})by(name)
连接监控需加这两项指标

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2022

Codecov Report

Merging #507 (ecf7140) into master (f65ba19) will increase coverage by 4.25%.
The diff coverage is 73.34%.

@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
+ Coverage   46.56%   50.82%   +4.25%     
==========================================
  Files         105      106       +1     
  Lines        6859     6808      -51     
==========================================
+ Hits         3194     3460     +266     
+ Misses       3415     3092     -323     
- Partials      250      256       +6     
Impacted Files Coverage Δ
pkg/client/redisgo/init.go 12.50% <12.50%> (ø)
pkg/client/redisgo/client.go 67.74% <67.74%> (ø)
pkg/client/redisgo/config.go 70.37% <70.37%> (ø)
pkg/client/redisgo/interceptor.go 85.71% <85.71%> (ø)
pkg/store/gorm/logger.go 37.50% <0.00%> (-14.59%) ⬇️
pkg/client/rocketmq/init.go 100.00% <0.00%> (+60.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sysulq sysulq changed the title feat: redigo feat: add support for go-redis Oct 25, 2022
@sysulq sysulq changed the title feat: add support for go-redis feat: add support for go-redis/v8 Oct 25, 2022
@sysulq
Copy link
Member

sysulq commented Oct 25, 2022

可以直接把redis替换掉 @papa-hexuan

@sysulq sysulq closed this Oct 25, 2022
@sysulq sysulq reopened this Oct 25, 2022
@sysulq sysulq added the enhancement New feature or request label Oct 25, 2022
sysulq
sysulq previously approved these changes Oct 26, 2022
"time"

prome "github.com/douyu/jupiter/pkg/core/metric"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt


"github.com/douyu/jupiter/pkg/server/governor"
jsoniter "github.com/json-iterator/go"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt

go.mod Outdated
@@ -9,14 +9,13 @@ require (
github.com/alicebob/miniredis/v2 v2.23.0
github.com/apache/rocketmq-client-go/v2 v2.1.1
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0
github.com/coocood/freecache v1.2.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge下master分支

go.mod Outdated
gorm.io/gorm v1.24.0
)

require (
github.com/coocood/freecache v1.2.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require可以合并下

}

// Singleton 单例模式
func (config *Config) Singleton() *Client {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果出错会panic,可以叫MustSingleton

}

// Build ..
func (config *Config) Build() *Client {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以是MustBuild

"github.com/stretchr/testify/assert"
)

var addr = "10.1.104.19:6740"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试redis用localhost,github上有跑一个本地的redis服务

dialTimeout="2s"
readTimeout="5s"
idleTimeout="60s"
username=""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix ident

@sysulq sysulq merged commit 4b199ff into douyu:master Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants