浏览代码

wip:打印日志debug

wangkaiyue 2 年之前
父节点
当前提交
1c3c5bbe90
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      internal/service/manager.go

+ 4 - 4
internal/service/manager.go

@@ -80,7 +80,7 @@ func (epm *esProxyManager) GetProxy(ctx context.Context, queryLevel int) (*httpu
 	if queryLevel+int(epm.esStatus) > 2 {
 	if queryLevel+int(epm.esStatus) > 2 {
 		return nil, fmt.Errorf("server is busy")
 		return nil, fmt.Errorf("server is busy")
 	}
 	}
-	//epm.Status()
+	g.Log().Debugf(ctx, "esProxyManager pool %+v", epm.Status())
 	select {
 	select {
 	case <-epm.getPool(queryLevel):
 	case <-epm.getPool(queryLevel):
 		c := <-epm.proxyPool
 		c := <-epm.proxyPool
@@ -110,10 +110,10 @@ func (epm *esProxyManager) getPool(queryLevel int) chan struct{} {
 	}
 	}
 }
 }
 
 
-func (epm *esProxyManager) Status() {
-	g.Dump(map[string]interface{}{
+func (epm *esProxyManager) Status() map[string]interface{} {
+	return map[string]interface{}{
 		"simple":  len(epm.simpleQueryPool),
 		"simple":  len(epm.simpleQueryPool),
 		"aggs":    len(epm.aggsQueryPool),
 		"aggs":    len(epm.aggsQueryPool),
 		"complex": len(epm.complexQueryPool),
 		"complex": len(epm.complexQueryPool),
-	})
+	}
 }
 }