rename agg rate to derivative
This commit is contained in:
parent
4cf91d7a40
commit
df1156fd92
|
@ -140,7 +140,7 @@ func (engine *Engine) generateAgg(metricItem *insight.MetricItem) map[string]int
|
||||||
aggType = metricItem.Statistic
|
aggType = metricItem.Statistic
|
||||||
case "count", "value_count":
|
case "count", "value_count":
|
||||||
aggType = "value_count"
|
aggType = "value_count"
|
||||||
case "rate":
|
case "derivative":
|
||||||
aggType = "max"
|
aggType = "max"
|
||||||
isPipeline = true
|
isPipeline = true
|
||||||
case "medium": // from es version 6.6
|
case "medium": // from es version 6.6
|
||||||
|
@ -407,7 +407,7 @@ func (engine *Engine) ExecuteQuery(rule *alerting.Rule, filterParam *alerting.Fi
|
||||||
}
|
}
|
||||||
metricData := []alerting.MetricData{}
|
metricData := []alerting.MetricData{}
|
||||||
CollectMetricData(searchResult["aggregations"], "", &metricData)
|
CollectMetricData(searchResult["aggregations"], "", &metricData)
|
||||||
//将 rate 求导数据 除以 bucket size (单位 /s)
|
//将 derivative 求导数据 除以 bucket size (单位 /s)
|
||||||
//statisticM := map[string] string{}
|
//statisticM := map[string] string{}
|
||||||
//for _, mi := range rule.Metrics.Items {
|
//for _, mi := range rule.Metrics.Items {
|
||||||
// statisticM[mi.Name] = mi.Statistic
|
// statisticM[mi.Name] = mi.Statistic
|
||||||
|
@ -422,7 +422,7 @@ func (engine *Engine) ExecuteQuery(rule *alerting.Rule, filterParam *alerting.Fi
|
||||||
//}
|
//}
|
||||||
//for i, _ := range metricData {
|
//for i, _ := range metricData {
|
||||||
// for k, d := range metricData[i].Data {
|
// for k, d := range metricData[i].Data {
|
||||||
// if statisticM[k] == "rate" {
|
// if statisticM[k] == "derivative" {
|
||||||
// for _, td := range d {
|
// for _, td := range d {
|
||||||
// if len(td) > 1 {
|
// if len(td) > 1 {
|
||||||
// if v, ok := td[1].(float64); ok {
|
// if v, ok := td[1].(float64); ok {
|
||||||
|
|
Loading…
Reference in New Issue