MCPcopy Index your code
hub / github.com/PasarGuard/node / TestGRPC_GetOutboundsStats

Function TestGRPC_GetOutboundsStats

controller/rpc/rpc_test.go:138–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func TestGRPC_GetOutboundsStats(t *testing.T) {
139 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)
140 defer cancel()
141
142 stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Reset_: true, Type: common.StatType_Outbounds})
143 if err != nil {
144 t.Fatalf("Failed to get outbounds stats: %v", err)
145 }
146
147 for _, stat := range stats.GetStats() {
148 log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)
149 }
150}
151
152func TestGRPC_GetInboundsStats(t *testing.T) {
153 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)

Callers

nothing calls this directly

Calls 1

GetStatsMethod · 0.65

Tested by

no test coverage detected