Skip to content

Commit

Permalink
cleanup(storage): gRPC plugin usings in benchmarks (#11693)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolduc authored May 22, 2023
1 parent 4dc1908 commit b4f17b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <vector>

namespace {
using ::google::cloud::storage_experimental::DefaultGrpcClient;
using ::google::cloud::testing_util::FormatSize;
using ::google::cloud::testing_util::Timer;
namespace gcs = ::google::cloud::storage;
Expand Down Expand Up @@ -123,8 +122,9 @@ class Iteration {
gcs::Client MakeClient(AggregateDownloadThroughputOptions const& options) {
auto opts = options.client_options;
#if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC
namespace gcs_ex = ::google::cloud::storage_experimental;
if (options.api == "GRPC") {
return DefaultGrpcClient(
return gcs_ex::DefaultGrpcClient(
std::move(opts).set<gcs_ex::GrpcPluginOption>("media"));
}
#endif // GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
#include "absl/time/time.h"

namespace {
using ::google::cloud::storage_experimental::DefaultGrpcClient;
using ::google::cloud::testing_util::FormatSize;
using ::google::cloud::testing_util::Timer;
namespace gcs = ::google::cloud::storage;
namespace gcs_ex = ::google::cloud::storage_experimental;
namespace gcs_bm = ::google::cloud::storage_benchmarks;
using gcs_bm::AggregateUploadThroughputOptions;
using gcs_bm::FormatBandwidthGbPerSecond;
Expand Down Expand Up @@ -116,8 +114,9 @@ gcs::Client MakeClient(AggregateUploadThroughputOptions const& options) {
// on almost all `.write()` requests.
.set<gcs::UploadBufferSizeOption>(256 * gcs_bm::kKiB);
#if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC
namespace gcs_ex = ::google::cloud::storage_experimental;
if (options.api == "GRPC") {
return DefaultGrpcClient(
return gcs_ex::DefaultGrpcClient(
std::move(opts).set<gcs_ex::GrpcPluginOption>("media"));
}
#endif // GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

namespace {
namespace gcs = ::google::cloud::storage;
namespace gcs_ex = ::google::cloud::storage_experimental;
namespace gcs_bm = ::google::cloud::storage_benchmarks;
using gcs_bm::ExperimentLibrary;
using gcs_bm::ExperimentTransport;
Expand Down Expand Up @@ -291,18 +290,18 @@ gcs_bm::ClientProvider BaseProvider(ThroughputOptions const& options) {
auto opts = google::cloud::Options{options.client_options}
.set<gcs::ProjectIdOption>(options.project_id);
#if GOOGLE_CLOUD_CPP_STORAGE_HAVE_GRPC
using ::google::cloud::storage_experimental::DefaultGrpcClient;
namespace gcs_ex = ::google::cloud::storage_experimental;
if (t == ExperimentTransport::kDirectPath) {
opts = google::cloud::internal::MergeOptions(options.direct_path_options,
std::move(opts));
opts.set<gcs_ex::GrpcPluginOption>("media");
return DefaultGrpcClient(std::move(opts));
return gcs_ex::DefaultGrpcClient(std::move(opts));
}
if (t == ExperimentTransport::kGrpc) {
opts = google::cloud::internal::MergeOptions(options.grpc_options,
std::move(opts));
opts.set<gcs_ex::GrpcPluginOption>("media");
return DefaultGrpcClient(std::move(opts));
return gcs_ex::DefaultGrpcClient(std::move(opts));
}
#else
(void)t; // disable unused parameter warning
Expand Down

0 comments on commit b4f17b6

Please sign in to comment.