|
@@ -153,22 +153,27 @@ func logServerLoad(server *TunnelServer) {
|
|
|
var memStats runtime.MemStats
|
|
var memStats runtime.MemStats
|
|
|
runtime.ReadMemStats(&memStats)
|
|
runtime.ReadMemStats(&memStats)
|
|
|
fields := LogFields{
|
|
fields := LogFields{
|
|
|
- "BuildRev": common.GetBuildInfo().BuildRev,
|
|
|
|
|
- "NumGoroutine": runtime.NumGoroutine(),
|
|
|
|
|
- "MemStats.Alloc": memStats.Alloc,
|
|
|
|
|
- "MemStats.TotalAlloc": memStats.TotalAlloc,
|
|
|
|
|
- "MemStats.Sys": memStats.Sys,
|
|
|
|
|
- "MemStats.PauseTotalNs": memStats.PauseTotalNs,
|
|
|
|
|
- "MemStats.PauseNs": memStats.PauseNs,
|
|
|
|
|
- "MemStats.NumGC": memStats.NumGC,
|
|
|
|
|
- "MemStats.GCCPUFraction": memStats.GCCPUFraction,
|
|
|
|
|
|
|
+ "BuildRev": common.GetBuildInfo().BuildRev,
|
|
|
|
|
+ "NumGoroutine": runtime.NumGoroutine(),
|
|
|
|
|
+ "MemStats": map[string]interface{}{
|
|
|
|
|
+ "Alloc": memStats.Alloc,
|
|
|
|
|
+ "TotalAlloc": memStats.TotalAlloc,
|
|
|
|
|
+ "Sys": memStats.Sys,
|
|
|
|
|
+ "PauseTotalNs": memStats.PauseTotalNs,
|
|
|
|
|
+ "PauseNs": memStats.PauseNs,
|
|
|
|
|
+ "NumGC": memStats.NumGC,
|
|
|
|
|
+ "GCCPUFraction": memStats.GCCPUFraction,
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// tunnel server stats
|
|
// tunnel server stats
|
|
|
for tunnelProtocol, stats := range server.GetLoadStats() {
|
|
for tunnelProtocol, stats := range server.GetLoadStats() {
|
|
|
|
|
+ tempMap := make(map[string]interface{})
|
|
|
for stat, value := range stats {
|
|
for stat, value := range stats {
|
|
|
- fields[tunnelProtocol+"."+stat] = value
|
|
|
|
|
|
|
+ tempMap[stat] = value
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ fields[tunnelProtocol] = tempMap
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
log.WithContextFields(fields).Info("load")
|
|
log.WithContextFields(fields).Info("load")
|