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

Function TestGRPC_GetSpecificInboundStats

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

Source from the content-addressed store, hash-verified

356}
357
358func TestGRPC_GetSpecificInboundStats(t *testing.T) {
359 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)
360 defer cancel()
361
362 stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Name: "Shadowsocks TCP", Reset_: true, Type: common.StatType_Inbounds})
363 if err != nil {
364 t.Fatalf("Failed to get inbound stats: %v", err)
365 }
366 for _, stat := range stats.GetStats() {
367 log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)
368 }
369}
370
371func TestGRPC_GetLogsStream(t *testing.T) {
372 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