mirror of
https://github.com/fatedier/frp.git
synced 2026-04-24 01:49:10 +08:00
Compare commits
1 Commits
dev
...
f7aa38b303
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7aa38b303 |
@@ -143,7 +143,6 @@ func (m *serverMetrics) OpenConnection(name string, _ string) {
|
|||||||
proxyStats, ok := m.info.ProxyStatistics[name]
|
proxyStats, ok := m.info.ProxyStatistics[name]
|
||||||
if ok {
|
if ok {
|
||||||
proxyStats.CurConns.Inc(1)
|
proxyStats.CurConns.Inc(1)
|
||||||
m.info.ProxyStatistics[name] = proxyStats
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +154,6 @@ func (m *serverMetrics) CloseConnection(name string, _ string) {
|
|||||||
proxyStats, ok := m.info.ProxyStatistics[name]
|
proxyStats, ok := m.info.ProxyStatistics[name]
|
||||||
if ok {
|
if ok {
|
||||||
proxyStats.CurConns.Dec(1)
|
proxyStats.CurConns.Dec(1)
|
||||||
m.info.ProxyStatistics[name] = proxyStats
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +166,6 @@ func (m *serverMetrics) AddTrafficIn(name string, _ string, trafficBytes int64)
|
|||||||
proxyStats, ok := m.info.ProxyStatistics[name]
|
proxyStats, ok := m.info.ProxyStatistics[name]
|
||||||
if ok {
|
if ok {
|
||||||
proxyStats.TrafficIn.Inc(trafficBytes)
|
proxyStats.TrafficIn.Inc(trafficBytes)
|
||||||
m.info.ProxyStatistics[name] = proxyStats
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +178,6 @@ func (m *serverMetrics) AddTrafficOut(name string, _ string, trafficBytes int64)
|
|||||||
proxyStats, ok := m.info.ProxyStatistics[name]
|
proxyStats, ok := m.info.ProxyStatistics[name]
|
||||||
if ok {
|
if ok {
|
||||||
proxyStats.TrafficOut.Inc(trafficBytes)
|
proxyStats.TrafficOut.Inc(trafficBytes)
|
||||||
m.info.ProxyStatistics[name] = proxyStats
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,15 +236,9 @@ func (m *serverMetrics) GetProxiesByTypeAndName(proxyType string, proxyName stri
|
|||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
|
|
||||||
for name, proxyStats := range m.info.ProxyStatistics {
|
proxyStats, ok := m.info.ProxyStatistics[proxyName]
|
||||||
if proxyStats.ProxyType != proxyType {
|
if ok && proxyStats.ProxyType == proxyType {
|
||||||
continue
|
res = toProxyStats(proxyName, proxyStats)
|
||||||
}
|
|
||||||
if name != proxyName {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
res = toProxyStats(name, proxyStats)
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user