-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Exporter for Proxy #2199
Conversation
086ab75
to
561d98b
Compare
561d98b
to
9e75379
Compare
b58fdbd
to
e13eff8
Compare
codis/pkg/proxy/stats.go
Outdated
@@ -72,6 +78,16 @@ func init() { | |||
cmdstats.qps.Set(int64(normalized + 0.5)) | |||
} | |||
}() | |||
|
|||
// Clear the accumulated maximum delay to 0 every 15 seconds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边辛苦小帅调整下,改成动态可配置重置时间,会更好些。避免信息缺失
"datacenter": "" | ||
} | ||
], | ||
"stats": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增指标也添加到测试用例中
7cf2b02
to
97039c2
Compare
codis/pkg/proxy/config.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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
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") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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())
}
97039c2
to
e6f0775
Compare
e6f0775
to
f7c73b8
Compare
cacb428
into
OpenAtomFoundation:unstable
* First edition * Exporter collects Proxy information. * Improve metrics * Dynamically adjust refresh time.
* First edition * Exporter collects Proxy information. * Improve metrics * Dynamically adjust refresh time.
issue : #2201
issue : #2208
Add metric collection for Proxy instances in the exporter
以下是本地压测set命令时, exporter采集的有关proxy的结果: