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

Method GetOutboundStats

backend/xray/api/stats.go:128–138  ·  view source on GitHub ↗
(ctx context.Context, tag string, reset bool)

Source from the content-addressed store, hash-verified

126}
127
128func (x *XrayHandler) GetOutboundStats(ctx context.Context, tag string, reset bool) (*common.StatResponse, error) {
129 if tag == "" {
130 return nil, errors.New("tag required")
131 }
132 resp, err := x.QueryStats(ctx, fmt.Sprintf("outbound>>>%s>>>", tag), reset)
133 if err != nil {
134 return nil, err
135 }
136
137 return buildStatResponse(resp.GetStat()), nil
138}
139
140func buildStatResponse(queryStats []*command.Stat) *common.StatResponse {
141 stats := &common.StatResponse{}

Callers 1

GetStatsMethod · 0.80

Calls 2

QueryStatsMethod · 0.95
buildStatResponseFunction · 0.85

Tested by

no test coverage detected