mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-27 12:35:21 -05:00
stats counter for inbound traffic
This commit is contained in:
@@ -395,10 +395,16 @@ func TestCommanderStats(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
System: &policy.SystemPolicy{
|
||||
Stats: &policy.SystemPolicy_Stats{
|
||||
InboundUplink: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
Inbound: []*core.InboundHandlerConfig{
|
||||
{
|
||||
Tag: "vmess",
|
||||
ReceiverSettings: serial.ToTypedMessage(&proxyman.ReceiverConfig{
|
||||
PortRange: net.SinglePortRange(serverPort),
|
||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||
@@ -521,5 +527,12 @@ func TestCommanderStats(t *testing.T) {
|
||||
assert(sresp.Stat.Name, Equals, name)
|
||||
assert(sresp.Stat.Value, Equals, int64(0))
|
||||
|
||||
sresp, err = sClient.GetStats(context.Background(), &statscmd.GetStatsRequest{
|
||||
Name: "inbound>>>vmess>>>traffic>>>uplink",
|
||||
Reset_: true,
|
||||
})
|
||||
assert(err, IsNil)
|
||||
assert(sresp.Stat.Value, Equals, int64(10240*1024))
|
||||
|
||||
CloseAllServers(servers)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user