Skip to content

feat: Exporter for Proxy - #2199

Merged
AlexStocks merged 4 commits into
OpenAtomFoundation:unstablefrom
dingxiaoshuai123:exporter_for_proxy
Dec 21, 2023
Merged

feat: Exporter for Proxy#2199
AlexStocks merged 4 commits into
OpenAtomFoundation:unstablefrom
dingxiaoshuai123:exporter_for_proxy

Conversation

@dingxiaoshuai123

@dingxiaoshuai123 dingxiaoshuai123 commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

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
Comment thread tools/pika_exporter/exporter/metrics/metrics.go Outdated
Comment thread tools/pika_exporter/discovery/discovery.go
Comment thread tools/pika_exporter/exporter/proxy.go Outdated
@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
Comment thread codis/pkg/proxy/stats.go Outdated
}
}()

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

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread codis/pkg/proxy/config.go Outdated
}

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

Copy link
Copy Markdown
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

Comment thread codis/pkg/proxy/proxy.go Outdated
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
Copy Markdown
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


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

Copy link
Copy Markdown
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
)

Comment thread tools/pika_exporter/exporter/future.go Outdated
}

type futureKeyForProxy struct {
addr, ID, productName string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

一行只写一个变量

Comment thread tools/pika_exporter/exporter/future.go Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
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())
}

Comment thread tools/pika_exporter/exporter/proxy.go
Comment thread tools/pika_exporter/exporter/proxy.go
@AlexStocks
AlexStocks merged commit cacb428 into OpenAtomFoundation:unstable Dec 21, 2023
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