sunty
2019-09-28 ec7a13fdca41ebe7d3f8e4968841d053975bf05e
EsApi.go
@@ -6,8 +6,10 @@
    "fmt"
    "strconv"
    "strings"
   "sync"
   "time"
    "basic.com/pubsub/protomsg.git"
   "basic.com/pubsub/protomsg.git"
        )
// 查询底库人员信息
@@ -622,9 +624,9 @@
   return total,nil
}
//实时报警任务比率
func RealTimeAlarmTaskRate(serverIp string, serverPort string) (sources map[string]int,err error){
func RealTimeAlarmTaskRate(serverIp string, serverPort string,indexName string) (sources map[string]int,err error){
   url := "http://" + serverIp + ":" + serverPort +
      "/videopersons,personaction/_search"
      "/"+indexName+"/_search"
   DSLJson := `{
   "size":0,
   "query":{
@@ -656,7 +658,7 @@
   if !ok {
      return nil, errors.New("http response interface can not change map[string]interface{}")
   }
   middle, ok := out["aggregations"].(map[string]int   erface{})
   middle, ok := out["aggregations"].(map[string]interface{})
   if !ok {
      return nil, errors.New("first hits change error!")
   }