MCPcopy Create free account
hub / github.com/cloudwan/gohan / BenchmarkPOSTAPI

Function BenchmarkPOSTAPI

server/server_test.go:1315–1331  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1313})
1314
1315func BenchmarkPOSTAPI(b *testing.B) {
1316 err := initBenchmarkDatabase()
1317 if err != nil {
1318 b.Fatal(err)
1319 }
1320
1321 err = startTestServer("./server_test_mysql_config.yaml")
1322 if err != nil {
1323 b.Fatal(err)
1324 }
1325
1326 b.ResetTimer()
1327 for i := 0; i < b.N; i++ {
1328 network := getNetwork("red"+strconv.Itoa(i), "red")
1329 httpRequest("POST", networkPluralURL, adminTokenID, network)
1330 }
1331}
1332
1333func BenchmarkGETAPI(b *testing.B) {
1334 err := initBenchmarkDatabase()

Callers

nothing calls this directly

Calls 5

initBenchmarkDatabaseFunction · 0.85
startTestServerFunction · 0.85
getNetworkFunction · 0.85
FatalMethod · 0.80
httpRequestFunction · 0.70

Tested by

no test coverage detected