(b *testing.B)
| 3167 | } |
| 3168 | |
| 3169 | func BenchmarkPut(b *testing.B) { |
| 3170 | base.DisableTestLogging(b) |
| 3171 | |
| 3172 | ctx := base.TestCtx(b) |
| 3173 | bucket, _ := ConnectToBucket(ctx, base.BucketSpec{ |
| 3174 | Server: base.UnitTestUrl(), |
| 3175 | BucketName: "Bucket"}, |
| 3176 | true) |
| 3177 | context, _ := NewDatabaseContext(ctx, "db", bucket, false, DatabaseContextOptions{}) |
| 3178 | db, _ := CreateDatabase(context) |
| 3179 | collection, ctx := GetSingleDatabaseCollectionWithUser(ctx, b, db) |
| 3180 | |
| 3181 | body := Body{"key1": "value1", "key2": 1234} |
| 3182 | b.ResetTimer() |
| 3183 | |
| 3184 | for i := 0; i < b.N; i++ { |
| 3185 | _, _, _ = collection.Put(ctx, fmt.Sprintf("doc%d", i), body) |
| 3186 | } |
| 3187 | |
| 3188 | db.Close(ctx) |
| 3189 | } |
| 3190 | |
| 3191 | var ( |
| 3192 | defaultProvider = "Google" |
nothing calls this directly
no test coverage detected