fix: lint eror (#82)
This commit is contained in:
parent
20a1d963c3
commit
7db9344bad
|
@ -43,7 +43,6 @@ import (
|
|||
type EsRequest struct {
|
||||
Doc string `json:"doc"`
|
||||
Privilege string `json:"privilege"`
|
||||
ClusterRequest
|
||||
IndexRequest
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ func TestCreateRule(t *testing.T) {
|
|||
|
||||
Metrics: Metric{
|
||||
Metric: insight.Metric{
|
||||
Groups: []insight.MetricGroupItem{{"metadata.labels.cluster_id", 10}, {"metadata.labels.node_id", 10}},
|
||||
Groups: []insight.MetricGroupItem{{Field: "metadata.labels.cluster_id", Limit: 10}, {Field: "metadata.labels.node_id", Limit: 10}},
|
||||
Items: []insight.MetricItem{
|
||||
{Name: "a", Field: "payload.elasticsearch.node_stats.fs.total.free_in_bytes", Statistic: "min"},
|
||||
{Name: "b", Field: "payload.elasticsearch.node_stats.fs.total.total_in_bytes", Statistic: "max"},
|
||||
|
|
|
@ -424,7 +424,6 @@ func (h *APIHandler) autoEnrollESNode(w http.ResponseWriter, req *http.Request,
|
|||
|
||||
if autoEnrollRunning.Load() {
|
||||
panic(errors.New("auto_enroll is already running in background"))
|
||||
return
|
||||
}
|
||||
|
||||
autoEnrollRunning.Swap(true)
|
||||
|
|
|
@ -468,7 +468,6 @@ func (h *APIHandler) FetchHostInfo(w http.ResponseWriter, req *http.Request, ps
|
|||
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, "", "", 15)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
networkInMetricItem := newMetricItem("network_in_rate", 1, SystemGroupKey)
|
||||
networkInMetricItem.AddAxi("network_rate", "group1", common.PositionLeft, "bytes", "0.[0]", "0.[0]", 5, true)
|
||||
|
|
|
@ -554,7 +554,6 @@ func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http
|
|||
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, id, metricType, 90)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
var metrics map[string]*common.MetricItem
|
||||
if bucketSize <= 60 {
|
||||
|
|
|
@ -113,7 +113,6 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
|
|||
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, clusterIDs[0], MetricTypeIndexStats, 15)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
|
||||
query := util.MapStr{}
|
||||
|
|
|
@ -522,7 +522,6 @@ func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http
|
|||
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, id, metricType, 90)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
|
||||
timeout := h.GetParameterOrDefault(req, "timeout", "60s")
|
||||
|
|
|
@ -308,7 +308,6 @@ func (h *APIHandler) FetchNodeInfo(w http.ResponseWriter, req *http.Request, ps
|
|||
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, clusterID, MetricTypeNodeStats, 15)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
// 索引速率
|
||||
indexMetric := newMetricItem("indexing", 1, OperationGroupKey)
|
||||
|
|
|
@ -466,7 +466,7 @@ func getMetadataByIndexPattern(clusterID, indexPattern, timeField string, filter
|
|||
}}
|
||||
if seriesType == "column" || seriesType == "pie" {
|
||||
seriesItem.Metric.Groups = []insight.MetricGroupItem{
|
||||
{aggField.Name, 10},
|
||||
{Field: aggField.Name, Limit: 10},
|
||||
}
|
||||
}
|
||||
fieldVis := insight.Visualization{
|
||||
|
|
|
@ -163,7 +163,6 @@ func (h *APIHandler) createInstance(w http.ResponseWriter, req *http.Request, ps
|
|||
obj.Name = res.Name
|
||||
}
|
||||
obj.Application = res.Application
|
||||
res.Network = res.Network
|
||||
|
||||
exists, err := orm.Get(obj)
|
||||
if err != nil && err != elastic.ErrNotFound {
|
||||
|
|
Loading…
Reference in New Issue