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

Function TestGRPC_GetInboundsStats

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

Source from the content-addressed store, hash-verified

150}
151
152func TestGRPC_GetInboundsStats(t *testing.T) {
153 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)
154 defer cancel()
155
156 stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Reset_: true, Type: common.StatType_Inbounds})
157 if err != nil {
158 t.Fatalf("Failed to get inbounds stats: %v", err)
159 }
160
161 for _, stat := range stats.GetStats() {
162 log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)
163 }
164}
165
166func TestGRPC_GetUsersStats(t *testing.T) {
167 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