MCPcopy
hub / github.com/syncthing/syncthing / benchmarkURL

Function benchmarkURL

test/http_test.go:236–246  ·  view source on GitHub ↗
(b *testing.B, url string)

Source from the content-addressed store, hash-verified

234}
235
236func benchmarkURL(b *testing.B, url string) {
237 p := setupAPIBench()
238 defer p.Stop()
239 b.ResetTimer()
240 for i := 0; i < b.N; i++ {
241 _, err := p.Get(url)
242 if err != nil {
243 b.Fatal(err)
244 }
245 }
246}
247
248func BenchmarkAPI_db_completion(b *testing.B) {
249 benchmarkURL(b, "/rest/db/completion?folder=default&device="+protocol.LocalDeviceID.String())

Callers 6

BenchmarkAPI_db_fileFunction · 0.85
BenchmarkAPI_db_ignoresFunction · 0.85
BenchmarkAPI_db_needFunction · 0.85
BenchmarkAPI_db_statusFunction · 0.85

Calls 4

setupAPIBenchFunction · 0.85
FatalMethod · 0.80
GetMethod · 0.65
StopMethod · 0.45

Tested by

no test coverage detected