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: Exporter for Proxy #2199

Merged

Conversation

dingxiaoshuai123
Copy link
Collaborator

@dingxiaoshuai123 dingxiaoshuai123 commented Dec 11, 2023

issue : #2201
issue : #2208

Add metric collection for Proxy instances in the exporter
以下是本地压测set命令时, exporter采集的有关proxy的结果:
image

@dingxiaoshuai123 dingxiaoshuai123 changed the title Exporter for Proxy feat: Exporter for Proxy Dec 11, 2023
@AlexStocks AlexStocks changed the title feat: Exporter for Proxy [WIP]feat: Exporter for Proxy Dec 11, 2023
@github-actions github-actions bot added the ✏️ Feature New feature or request label Dec 12, 2023
@dingxiaoshuai123 dingxiaoshuai123 changed the title [WIP]feat: Exporter for Proxy feat: Exporter for Proxy Dec 13, 2023
@@ -72,6 +78,16 @@ func init() {
cmdstats.qps.Set(int64(normalized + 0.5))
}
}()

// Clear the accumulated maximum delay to 0 every 15 seconds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

这边辛苦小帅调整下,改成动态可配置重置时间,会更好些。避免信息缺失

"datacenter": ""
}
],
"stats": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

新增指标也添加到测试用例中

@@ -323,5 +328,9 @@ func (c *Config) Validate() error {
return errors.New("invalid metrics_report_statsd_period")
}

if c.MaxDelayRefreshTimeInterval <= 0 {
return errors.New("invalid max_delay_refresh_time_interval")
Copy link
Contributor

Choose a reason for hiding this comment

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

max_delay_refresh_time_interval must be greater than 0

return redis.NewErrorf("err:%s.", err)
}
if d := p.config.MaxDelayRefreshTimeInterval.Duration(); d <= 0 {
return redis.NewErrorf("invalid max_delay_refresh_time_interval")
Copy link
Contributor

Choose a reason for hiding this comment

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

max_delay_refresh_time_interval must be greater than 0

@@ -174,7 +206,7 @@ func (d *codisDiscovery) CheckUpdate(updatechan chan int, codisaddr string) {
}

func (d *codisDiscovery) comparedis(new_instance *codisDiscovery) bool {
var addrs []string
var addrs, addrsProxy []string
Copy link
Contributor

Choose a reason for hiding this comment

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

var (
addrs []string
addrsProxy []string
diff bool
)

@@ -36,3 +36,38 @@ func (f *future) Wait() map[futureKey]error {
defer f.Unlock()
return f.m
}

type futureKeyForProxy struct {
addr, ID, productName string
Copy link
Contributor

Choose a reason for hiding this comment

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

一行只写一个变量


func (f *futureForProxy) Done(key futureKeyForProxy, val error) {
f.Lock()
defer f.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

defer func() {
f.Unlock()
f.wait.Done()
}()

elemType := field.Index(j).Type()
elemValue := field.Index(j)
if elemType.Kind() == reflect.Struct {
var key string
Copy link
Contributor

Choose a reason for hiding this comment

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

key := elemValue.Field(0).String()
for p := 1; p < elemValue.NumField(); p++ {
cmdResult[key] = append(cmdResult[key], elemValue.Field(p).Int())
}

@AlexStocks AlexStocks merged commit cacb428 into OpenAtomFoundation:unstable Dec 21, 2023
12 of 14 checks passed
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
* First edition

* Exporter collects Proxy information.

* Improve metrics

* Dynamically adjust refresh time.
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
* First edition

* Exporter collects Proxy information.

* Improve metrics

* Dynamically adjust refresh time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants