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

Function TestGRPC_GetSpecificOutboundStats

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

Source from the content-addressed store, hash-verified

343}
344
345func TestGRPC_GetSpecificOutboundStats(t *testing.T) {
346 ctx, cancel := context.WithTimeout(sharedTestCtx.ctxWithSession, 5*time.Second)
347 defer cancel()
348
349 stats, err := sharedTestCtx.client.GetStats(ctx, &common.StatRequest{Name: "direct", Reset_: true, Type: common.StatType_Outbound})
350 if err != nil {
351 t.Fatalf("Failed to get outbound stats: %v", err)
352 }
353 for _, stat := range stats.GetStats() {
354 log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)
355 }
356}
357
358func TestGRPC_GetSpecificInboundStats(t *testing.T) {
359 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