@@ -133,13 +133,10 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
133
133
var top = len (clusterIDs ) + 1
134
134
135
135
bucketSize := GetMinBucketSize ()
136
- if bucketSize < 20 {
137
- bucketSize = 20
136
+ if bucketSize < 60 {
137
+ bucketSize = 60
138
138
}
139
139
var metricLen = 15
140
- if bucketSize <= 60 {
141
- metricLen += 2
142
- }
143
140
var bucketSizeStr = fmt .Sprintf ("%vs" , bucketSize )
144
141
indexMetricItems := []GroupMetricItem {}
145
142
metricItem := newMetricItem ("cluster_indexing" , 2 , "cluster" )
@@ -260,7 +257,7 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
260
257
for _ , line := range indexMetrics ["cluster_indexing" ].Lines {
261
258
// remove first metric dot
262
259
data := line .Data
263
- if v , ok := data .([][]interface {}); ok && len (v )> 0 && bucketSize <= 60 {
260
+ if v , ok := data .([][]interface {}); ok && len (v )> 0 {
264
261
// remove first metric dot
265
262
temp := v [1 :]
266
263
// // remove first last dot
@@ -274,7 +271,7 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
274
271
searchMetricData := util.MapStr {}
275
272
for _ , line := range indexMetrics ["cluster_search" ].Lines {
276
273
data := line .Data
277
- if v , ok := data .([][]interface {}); ok && len (v )> 0 && bucketSize <= 60 {
274
+ if v , ok := data .([][]interface {}); ok && len (v )> 0 {
278
275
// remove first metric dot
279
276
temp := v [1 :]
280
277
// // remove first last dot
@@ -286,12 +283,6 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
286
283
searchMetricData [line .Metric .Label ] = data
287
284
}
288
285
289
- searchR1 , err := elastic .GetClient (clusterID ).SearchWithRawQueryDSL (getAllMetricsIndex (), util .MustToJSONBytes (query ))
290
- if err != nil {
291
- panic (err )
292
- }
293
-
294
-
295
286
//fetch recent cluster health status
296
287
bucketItem := common .NewBucketItem (
297
288
common .TermsBucket , util.MapStr {
@@ -409,7 +400,7 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
409
400
410
401
util .MergeFields (query , aggs , true )
411
402
412
- searchR1 , err = elastic .GetClient (global .MustLookupString (elastic .GlobalSystemElasticsearchID )).SearchWithRawQueryDSL (getAllMetricsIndex (), util .MustToJSONBytes (query ))
403
+ searchR1 , err : = elastic .GetClient (global .MustLookupString (elastic .GlobalSystemElasticsearchID )).SearchWithRawQueryDSL (getAllMetricsIndex (), util .MustToJSONBytes (query ))
413
404
if err != nil {
414
405
panic (err )
415
406
}
0 commit comments