Browse Source

Adds cache pressure in logger

Manu Mtz-Almeida 11 years ago
parent
commit
027341c80b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      logger.go

+ 2 - 1
logger.go

@@ -48,10 +48,11 @@ func Logger() HandlerFunc {
 			color = red
 			color = red
 		}
 		}
 		latency := time.Since(start)
 		latency := time.Since(start)
-		logger.Printf("[GIN] %v |%s %3d %s| %12v | %3s %s\n",
+		logger.Printf("[GIN] %v |%s %3d %s| %12v | %3.1f%% | %3s | %s\n",
 			time.Now().Format("2006/01/02 - 15:04:05"),
 			time.Now().Format("2006/01/02 - 15:04:05"),
 			color, c.Writer.Status(), reset,
 			color, c.Writer.Status(), reset,
 			latency,
 			latency,
+			c.Engine.CacheStress()*100,
 			c.Req.Method, c.Req.URL.Path,
 			c.Req.Method, c.Req.URL.Path,
 		)
 		)