Skip to content

Commit

Permalink
feat(bigtable): loadtest support app profile (#5882)
Browse files Browse the repository at this point in the history
Hi, I found using an app profile greatly improved my 99th performance. So it would be nice to support it profiles in `loadtest`.


Can be used like this.
```
./loadtest -project $PROJECT -instance $INSTANCE
2022/04/11 17:06:02 -creds flag unset, will use gcloud credential
2022/04/11 17:06:03 Dialing connections...
2022/04/11 17:06:03 Setting up scratch table...
2022/04/11 17:06:47 Starting load test... (run for 5s)
2022/04/11 17:06:58 Reads (2036 ok / 2036 tries):
min:             3.55575ms
median:          5.755416ms
max:             7.140176875s
95th percentile: 1.187244416s
99th percentile: 6.039376264s
2022/04/11 17:06:58 Writes (2060 ok / 2060 tries):
min:             3.952833ms
median:          6.225167ms
max:             7.369702958s
95th percentile: 1.47177056s
99th percentile: 5.784249186s
➜  bigtable git:(main) ✗ ./loadtest -project $PROJECT -instance $INSTANCE -app_profile syd
2022/04/11 17:07:05 -creds flag unset, will use gcloud credential
2022/04/11 17:07:06 Dialing connections...
2022/04/11 17:07:06 Setting up scratch table...
2022/04/11 17:08:36 Starting load test... (run for 5s)
2022/04/11 17:08:41 Reads (18951 ok / 18951 tries):
min:             3.921583ms
median:          10.810541ms
max:             315.866792ms
95th percentile: 22.642271ms
99th percentile: 40.233812ms
2022/04/11 17:08:41 Writes (18686 ok / 18686 tries):
min:             4.494417ms
median:          11.303666ms
max:             328.434125ms
95th percentile: 22.95579ms
99th percentile: 41.21401ms
```
  • Loading branch information
stephennancekivell authored May 2, 2022
1 parent dd8973b commit ec00e5a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bigtable/cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ var (
scratchTable = flag.String("scratch_table", "loadtest-scratch", "name of table to use; should not already exist")
csvOutput = flag.String("csv_output", "",
"output path for statistics in .csv format. If this file already exists it will be overwritten.")
poolSize = flag.Int("pool_size", 1, "size of the gRPC connection pool to use for the data client")
reqCount = flag.Int("req_count", 100, "number of concurrent requests")
poolSize = flag.Int("pool_size", 1, "size of the gRPC connection pool to use for the data client")
reqCount = flag.Int("req_count", 100, "number of concurrent requests")
appProfile = flag.String("app_profile", "", "The application profile to use.")

config *cbt.Config
client *bigtable.Client
Expand Down Expand Up @@ -94,7 +95,13 @@ func main() {
}

log.Printf("Dialing connections...")
client, err = bigtable.NewClient(context.Background(), config.Project, config.Instance, options...)
client, err = bigtable.NewClientWithConfig(
context.Background(),
config.Project,
config.Instance,
bigtable.ClientConfig{AppProfile: *appProfile},
options...,
)
if err != nil {
log.Fatalf("Making bigtable.Client: %v", err)
}
Expand Down

0 comments on commit ec00e5a

Please sign in to comment.