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

Function TestREST_GetOutboundsStats

controller/rest/rest_test.go:212–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

210}
211
212func TestREST_GetOutboundsStats(t *testing.T) {
213 var stats common.StatResponse
214 if err := sharedTestCtx.createAuthenticatedRequest("GET", "/stats", &common.StatRequest{Reset_: true, Type: common.StatType_Outbounds}, &stats); err != nil {
215 t.Fatalf("Failed to get outbound stats: %v", err)
216 }
217
218 for _, stat := range stats.GetStats() {
219 log.Printf("Outbound Stat - Name: %s, Traffic: %d, Type: %s, Link: %s",
220 stat.GetName(), stat.GetValue(), stat.GetType(), stat.GetLink())
221 }
222}
223
224func TestREST_GetInboundsStats(t *testing.T) {
225 var stats common.StatResponse

Callers

nothing calls this directly

Calls 5

GetStatsMethod · 0.95
GetNameMethod · 0.45
GetValueMethod · 0.45
GetTypeMethod · 0.45
GetLinkMethod · 0.45

Tested by

no test coverage detected