// Get stats data api.
Get stats data api.
// Get stats data api .
func (m *serverMetrics) GetServer() *ServerStats {
	m.mu.Lock()
	defer m.mu.Unlock()
	s := &ServerStats{
		TotalTrafficIn:  m.info.TotalTrafficIn.TodayCount(),
		TotalTrafficOut: m.info.TotalTrafficOut.TodayCount(),
		CurConns:        m.info.CurConns.Count(),
		ClientCounts:    m.info.ClientCounts.Count(),
		ProxyTypeCounts: make(map[string]int64),
	}
	for k, v := range m.info.ProxyTypeCounts {
		s.ProxyTypeCounts[k] = v.Count()
	}
	return s
}
func ( m * serverMetrics ) GetServer ( ) * ServerStats { m . mu . Lock ( ) defer m . mu . Unlock ( ) s := & ServerStats { TotalTrafficIn : m . info . TotalTrafficIn . TodayCount ( ) , TotalTrafficOut : m . info . TotalTrafficOut . TodayCount ( ) , CurConns : m . info . CurConns . Count ( ) , ClientCounts : m . info . ClientCounts . Count ( ) , ProxyTypeCounts : make ( map [ string ] int64 ) , } for k , v := range m . info . ProxyTypeCounts { s . ProxyTypeCounts [ k ] = v . Count ( ) } return s }
Get stats data api.
Get stats data api .