优化
This commit is contained in:
		
							parent
							
								
									07d0102803
								
							
						
					
					
						commit
						0cce4ee276
					
				@ -25,15 +25,6 @@ type ReportController struct {
 | 
			
		||||
	BaseController
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var parserPool *parser.Pool
 | 
			
		||||
 | 
			
		||||
func init(){
 | 
			
		||||
	var err error
 | 
			
		||||
	parserPool,err = parser.NewParserPool("fastjson")
 | 
			
		||||
	if err!=nil{
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//上报接口
 | 
			
		||||
func (this ReportController) ReportAction(ctx *fasthttp.RequestCtx) {
 | 
			
		||||
@ -101,9 +92,10 @@ func (this ReportController) ReportAction(ctx *fasthttp.RequestCtx) {
 | 
			
		||||
 | 
			
		||||
	if reportService.IsDebugUser(debug, xwlDistinctId, tableId) {
 | 
			
		||||
		kafkaData := duck.GetkafkaData()
 | 
			
		||||
		pool := parserPool.Get()
 | 
			
		||||
		defer parserPool.Put(pool)
 | 
			
		||||
		metric, debugErr :=  pool.Parse(body)
 | 
			
		||||
 | 
			
		||||
		pp := parser.FastjsonParser{}
 | 
			
		||||
 | 
			
		||||
		metric, debugErr := pp.Parse(kafkaData.ReqData)
 | 
			
		||||
 | 
			
		||||
		if debugErr != nil {
 | 
			
		||||
			logs.Logger.Error("parser.ParseKafkaData ", zap.Error(err))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user