-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Query batch feature #1052
Query batch feature #1052
Conversation
src/pkg/common/api.go
Outdated
@@ -0,0 +1,76 @@ | |||
package common |
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.
It might be better to change the package name to prom
1.extract server/api.go 2.make webapi reading prom with reusing server's API,not a new prom client
clear code
src/webapi/prom/prom.go
Outdated
@@ -39,6 +42,19 @@ func (cs *ClustersType) Get(name string) (*ClusterType, bool) { | |||
return c, has | |||
} | |||
|
|||
func (cs *ClustersType) GetClusters() []*ClusterType { |
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.
这个方法是不是已经不需要了?
src/webapi/prom/prom.go
Outdated
@@ -61,17 +77,34 @@ func initClustersFromConfig() error { | |||
opts := config.C.Clusters | |||
|
|||
for i := 0; i < len(opts); i++ { | |||
transport := &http.Transport{ |
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.
initClustersFromConfig 和 initClustersFromAPI 中有大片代码重复,看看是否可以抽取出方法?
src/webapi/webapi.go
Outdated
@@ -118,6 +118,10 @@ func (a Webapi) initialize() (func(), error) { | |||
if err = prom.Init(); err != nil { | |||
return nil, err | |||
} | |||
// init reader clients |
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.
重复了,上面已经有了prom.Init
What type of PR is this?
batch query in single request for one panel
What this PR does / why we need it:
the browser limit request num,so when many panel loading metric data, some web request will be block.
Which issue(s) this PR fixes:
no issue fix, but this may be faster,and grafana has implement this.
for code:
Kindly give me your advice,Thanks!