(b *testing.B)
| 2159 | } |
| 2160 | |
| 2161 | func Benchmark_RestApiGetDocPerformanceFullRevCache(b *testing.B) { |
| 2162 | base.SetUpBenchmarkLogging(b, base.LevelWarn, base.KeyHTTP) |
| 2163 | // Create test documents |
| 2164 | rt := NewRestTester(b, nil) |
| 2165 | defer rt.Close() |
| 2166 | keys := make([]string, 5000) |
| 2167 | for i := 0; i < 5000; i++ { |
| 2168 | key := fmt.Sprintf("doc%d", i) |
| 2169 | keys[i] = key |
| 2170 | rt.SendRequest("PUT", "/{{.keyspace}}/"+key, `{"prop":true}`) |
| 2171 | } |
| 2172 | |
| 2173 | b.ResetTimer() |
| 2174 | |
| 2175 | b.RunParallel(func(pb *testing.PB) { |
| 2176 | // GET the document until test run has completed |
| 2177 | for pb.Next() { |
| 2178 | key := keys[rand.Intn(5000)] |
| 2179 | rt.SendRequest("GET", fmt.Sprintf("/{{.keyspace}}/%s?rev=1-45ca73d819d5b1c9b8eea95290e79004", key), "") |
| 2180 | } |
| 2181 | }) |
| 2182 | } |
| 2183 | |
| 2184 | func TestHandleProfiling(t *testing.T) { |
| 2185 | rt := NewRestTester(t, nil) |
nothing calls this directly
no test coverage detected