Skip to content

Commit

Permalink
Add benchmark for compression
Browse files Browse the repository at this point in the history
  • Loading branch information
camdencheek committed Aug 11, 2020
1 parent dd0329c commit 803080d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions operator/builtin/output/google_cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ func startServer() (*grpc.ClientConn, chan *logpb.WriteLogEntriesRequest, func()
}

type googleCloudOutputBenchmark struct {
name string
entry *entry.Entry
name string
entry *entry.Entry
configMod func(*GoogleCloudOutputConfig)
}

func (g *googleCloudOutputBenchmark) Run(b *testing.B) {
Expand Down Expand Up @@ -345,27 +346,31 @@ func BenchmarkGoogleCloudOutput(b *testing.B) {
Timestamp: t,
Record: "test",
},
nil,
},
{
"MapRecord",
&entry.Entry{
Timestamp: t,
Record: mapOfSize(1, 0),
},
nil,
},
{
"LargeMapRecord",
&entry.Entry{
Timestamp: t,
Record: mapOfSize(30, 0),
},
nil,
},
{
"DeepMapRecord",
&entry.Entry{
Timestamp: t,
Record: mapOfSize(1, 10),
},
nil,
},
{
"Labels",
Expand All @@ -376,6 +381,17 @@ func BenchmarkGoogleCloudOutput(b *testing.B) {
"test": "val",
},
},
nil,
},
{
"Compression",
&entry.Entry{
Timestamp: t,
Record: "compressiblecompressiblecompressiblecompressiblecompressiblecompressiblecompressible",
},
func(cfg *GoogleCloudOutputConfig) {
cfg.UseCompression = true
},
},
}

Expand Down

0 comments on commit 803080d

Please sign in to comment.