MCPcopy Create free account
hub / github.com/PasarGuard/node / GetStats

Method GetStats

backend/xray/stats.go:22–43  ·  view source on GitHub ↗
(ctx context.Context, request *common.StatRequest)

Source from the content-addressed store, hash-verified

20}
21
22func (x *Xray) GetStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) {
23 switch request.GetType() {
24
25 case common.StatType_Outbounds:
26 return x.handler.GetOutboundsStats(ctx, request.GetReset_())
27 case common.StatType_Outbound:
28 return x.handler.GetOutboundStats(ctx, request.GetName(), request.GetReset_())
29
30 case common.StatType_Inbounds:
31 return x.handler.GetInboundsStats(ctx, request.GetReset_())
32 case common.StatType_Inbound:
33 return x.handler.GetInboundStats(ctx, request.GetName(), request.GetReset_())
34
35 case common.StatType_UsersStat:
36 return x.handler.GetUsersStats(ctx, request.GetReset_())
37 case common.StatType_UserStat:
38 return x.handler.GetUserStats(ctx, request.GetName(), request.GetReset_())
39
40 default:
41 return nil, errors.New("not implemented stat type")
42 }
43}

Callers

nothing calls this directly

Calls 9

GetOutboundsStatsMethod · 0.80
GetReset_Method · 0.80
GetOutboundStatsMethod · 0.80
GetInboundsStatsMethod · 0.80
GetInboundStatsMethod · 0.80
GetUserStatsMethod · 0.80
GetTypeMethod · 0.45
GetNameMethod · 0.45
GetUsersStatsMethod · 0.45

Tested by

no test coverage detected