databroker: add support for putting multiple records (#3291)

* databroker: add support for putting multiple records

* add OptimumPutRequestsFromRecords function

* replace GetAll with SyncLatest

* fix stream when there are no records
This commit is contained in:
Caleb Doxsey 2022-04-26 22:41:38 +00:00 committed by GitHub
parent 343fa43ed4
commit f73c5c615f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 790 additions and 660 deletions

View file

@ -56,11 +56,11 @@ func TestServerSync(t *testing.T) {
for i := 0; i < numRecords; i++ {
res, err := c.Put(ctx, &databroker.PutRequest{
Record: &databroker.Record{
Records: []*databroker.Record{{
Type: any.TypeUrl,
Id: strconv.Itoa(i),
Data: any,
},
}},
})
require.NoError(t, err)
serverVersion = res.GetServerVersion()
@ -106,11 +106,11 @@ func BenchmarkSync(b *testing.B) {
for i := 0; i < numRecords; i++ {
_, _ = c.Put(ctx, &databroker.PutRequest{
Record: &databroker.Record{
Records: []*databroker.Record{{
Type: any.TypeUrl,
Id: strconv.Itoa(i),
Data: any,
},
}},
})
}