MCPcopy
hub / github.com/gin-gonic/gin / BenchmarkOneRouteJSON

Function BenchmarkOneRouteJSON

benchmarks_test.go:51–60  ·  benchmarks_test.go::BenchmarkOneRouteJSON
(B *testing.B)

Source from the content-addressed store, hash-verified

49}
50
51func BenchmarkOneRouteJSON(B *testing.B) {
52 router := New()
53 data := struct {
54 Status string `json:"status"`
55 }{"ok"}
56 router.GET("/json", func(c *Context) {
57 c.JSON(http.StatusOK, data)
58 })
59 runRequest(B, router, http.MethodGet, "/json")
60}
61
62func BenchmarkOneRouteHTML(B *testing.B) {
63 router := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
runRequestFunction · 0.85
GETMethod · 0.65
JSONMethod · 0.45

Tested by

no test coverage detected