Skip to content

Commit a0bda06

Browse files
authored
feat(storage): release *StallMinimumThroughputOption (#9813)
These options have proven useful. Time to move them out of `storage_experimental`.
1 parent eb5ad36 commit a0bda06

12 files changed

+50
-61
lines changed

google/cloud/storage/benchmarks/aggregate_download_throughput_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ ParseAggregateDownloadThroughputOptions(std::vector<std::string> const& argv,
144144
" is aborted if the average transfer rate is below this limit for"
145145
" the period set via `storage::DownloadStallTimeoutOption`.",
146146
[&options](std::string const& val) {
147-
options.client_options.set<gcs_ex::DownloadStallMinimumRateOption>(
147+
options.client_options.set<gcs::DownloadStallMinimumRateOption>(
148148
static_cast<std::uint32_t>(ParseBufferSize(val)));
149149
}},
150150
{"--grpc-background-threads",

google/cloud/storage/benchmarks/aggregate_download_throughput_options_test.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ TEST(AggregateDownloadThroughputOptions, Basic) {
7070
options->client_options.get<EndpointOption>());
7171
EXPECT_EQ(std::chrono::seconds(10),
7272
options->client_options.get<gcs::DownloadStallTimeoutOption>());
73-
EXPECT_EQ(
74-
100 * kKiB,
75-
options->client_options.get<gcs_ex::DownloadStallMinimumRateOption>());
73+
EXPECT_EQ(100 * kKiB,
74+
options->client_options.get<gcs::DownloadStallMinimumRateOption>());
7675
EXPECT_EQ(4,
7776
options->client_options.get<GrpcBackgroundThreadPoolSizeOption>());
7877
EXPECT_EQ(123, options->client_options.get<gcs::ConnectionPoolSizeOption>());

google/cloud/storage/benchmarks/aggregate_upload_throughput_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ ParseAggregateUploadThroughputOptions(std::vector<std::string> const& argv,
157157
" is aborted if the average transfer rate is below this limit for"
158158
" the period set via `storage::TransferStallTimeoutOption`.",
159159
[&options](std::string const& val) {
160-
options.client_options.set<gcs_ex::TransferStallMinimumRateOption>(
160+
options.client_options.set<gcs::TransferStallMinimumRateOption>(
161161
static_cast<std::uint32_t>(ParseBufferSize(val)));
162162
}},
163163
{"--grpc-background-threads",

google/cloud/storage/benchmarks/aggregate_upload_throughput_options_test.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ TEST(AggregateUploadThroughputOptions, Basic) {
7272
options->client_options.get<EndpointOption>());
7373
EXPECT_EQ(std::chrono::seconds(10),
7474
options->client_options.get<gcs::TransferStallTimeoutOption>());
75-
EXPECT_EQ(
76-
100 * kKiB,
77-
options->client_options.get<gcs_ex::TransferStallMinimumRateOption>());
75+
EXPECT_EQ(100 * kKiB,
76+
options->client_options.get<gcs::TransferStallMinimumRateOption>());
7877
EXPECT_EQ(4,
7978
options->client_options.get<GrpcBackgroundThreadPoolSizeOption>());
8079
EXPECT_EQ(123, options->client_options.get<gcs::ConnectionPoolSizeOption>());

google/cloud/storage/benchmarks/benchmark_utils.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ namespace cloud {
3434
namespace storage_benchmarks {
3535

3636
namespace gcs = ::google::cloud::storage;
37-
namespace gcs_ex = ::google::cloud::storage_experimental;
3837

3938
void DeleteAllObjects(google::cloud::storage::Client client,
4039
std::string const& bucket_name, int thread_count) {
@@ -197,20 +196,20 @@ void PrintOptions(std::ostream& os, std::string const& prefix,
197196
<< absl::FormatDuration(
198197
absl::FromChrono(options.get<gcs::TransferStallTimeoutOption>()));
199198
}
200-
if (options.has<gcs_ex::TransferStallMinimumRateOption>()) {
199+
if (options.has<gcs::TransferStallMinimumRateOption>()) {
201200
os << "\n# " << prefix << " Transfer Stall Minimum Rate: "
202201
<< testing_util::FormatSize(
203-
options.get<gcs_ex::TransferStallMinimumRateOption>());
202+
options.get<gcs::TransferStallMinimumRateOption>());
204203
}
205204
if (options.has<gcs::DownloadStallTimeoutOption>()) {
206205
os << "\n# " << prefix << " Download Stall Timeout: "
207206
<< absl::FormatDuration(
208207
absl::FromChrono(options.get<gcs::DownloadStallTimeoutOption>()));
209208
}
210-
if (options.has<gcs_ex::DownloadStallMinimumRateOption>()) {
209+
if (options.has<gcs::DownloadStallMinimumRateOption>()) {
211210
os << "\n# " << prefix << " Download Stall Minimum Rate: "
212211
<< testing_util::FormatSize(
213-
options.get<gcs_ex::DownloadStallMinimumRateOption>());
212+
options.get<gcs::DownloadStallMinimumRateOption>());
214213
}
215214

216215
if (options.has<google::cloud::storage::internal::TargetApiVersionOption>()) {

google/cloud/storage/benchmarks/throughput_options.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace storage_benchmarks {
2525
namespace {
2626

2727
namespace gcs = ::google::cloud::storage;
28-
namespace gcs_ex = ::google::cloud::storage_experimental;
2928

3029
Status ValidateQuantizedRange(std::string const& name,
3130
absl::optional<std::int64_t> minimum,
@@ -368,7 +367,7 @@ google::cloud::StatusOr<ThroughputOptions> ParseThroughputOptions(
368367
" is aborted if the average transfer rate is below this limit for"
369368
" the period set via `storage::TransferStallTimeoutOption`.",
370369
[&options](std::string const& val) {
371-
options.client_options.set<gcs_ex::TransferStallMinimumRateOption>(
370+
options.client_options.set<gcs::TransferStallMinimumRateOption>(
372371
static_cast<std::uint32_t>(ParseBufferSize(val)));
373372
}},
374373
{"--download-stall-timeout",
@@ -385,7 +384,7 @@ google::cloud::StatusOr<ThroughputOptions> ParseThroughputOptions(
385384
" is aborted if the average transfer rate is below this limit for"
386385
" the period set via `storage::DownloadStallTimeoutOption`.",
387386
[&options](std::string const& val) {
388-
options.client_options.set<gcs_ex::DownloadStallMinimumRateOption>(
387+
options.client_options.set<gcs::DownloadStallMinimumRateOption>(
389388
static_cast<std::uint32_t>(ParseBufferSize(val)));
390389
}},
391390
{"--minimum-sample-delay",

google/cloud/storage/benchmarks/throughput_options_test.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace storage_benchmarks {
2626
namespace {
2727

2828
namespace gcs = ::google::cloud::storage;
29-
namespace gcs_ex = ::google::cloud::storage_experimental;
3029
using ::testing::ElementsAre;
3130
using ::testing::UnorderedElementsAre;
3231

@@ -112,14 +111,12 @@ TEST(ThroughputOptions, Basic) {
112111
options->direct_path_options.get<EndpointOption>());
113112
EXPECT_EQ(std::chrono::seconds(86400),
114113
options->client_options.get<gcs::TransferStallTimeoutOption>());
115-
EXPECT_EQ(
116-
7 * kKiB,
117-
options->client_options.get<gcs_ex::TransferStallMinimumRateOption>());
114+
EXPECT_EQ(7 * kKiB,
115+
options->client_options.get<gcs::TransferStallMinimumRateOption>());
118116
EXPECT_EQ(std::chrono::seconds(86401),
119117
options->client_options.get<gcs::DownloadStallTimeoutOption>());
120-
EXPECT_EQ(
121-
9 * kKiB,
122-
options->client_options.get<gcs_ex::DownloadStallMinimumRateOption>());
118+
EXPECT_EQ(9 * kKiB,
119+
options->client_options.get<gcs::DownloadStallMinimumRateOption>());
123120
EXPECT_EQ("vN",
124121
options->rest_options.get<gcs::internal::TargetApiVersionOption>());
125122
EXPECT_EQ(16,

google/cloud/storage/client_options.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ Options DefaultOptions(std::shared_ptr<oauth2::Credentials> credentials,
187187
.set<MaximumCurlSocketSendSizeOption>(0)
188188
.set<TransferStallTimeoutOption>(std::chrono::seconds(
189189
GOOGLE_CLOUD_CPP_STORAGE_DEFAULT_DOWNLOAD_STALL_TIMEOUT))
190-
.set<storage_experimental::TransferStallMinimumRateOption>(1)
191-
.set<storage_experimental::DownloadStallMinimumRateOption>(1)
190+
.set<TransferStallMinimumRateOption>(1)
191+
.set<DownloadStallMinimumRateOption>(1)
192192
.set<RetryPolicyOption>(
193193
LimitedTimeRetryPolicy(
194194
STORAGE_CLIENT_DEFAULT_MAXIMUM_RETRY_PERIOD)
@@ -246,11 +246,11 @@ Options DefaultOptions(std::shared_ptr<oauth2::Credentials> credentials,
246246
.set<rest::DownloadStallTimeoutOption>(
247247
o.get<DownloadStallTimeoutOption>())
248248
.set<rest::DownloadStallMinimumRateOption>(
249-
o.get<storage_experimental::DownloadStallMinimumRateOption>())
249+
o.get<DownloadStallMinimumRateOption>())
250250
.set<rest::TransferStallTimeoutOption>(
251251
o.get<TransferStallTimeoutOption>())
252252
.set<rest::TransferStallMinimumRateOption>(
253-
o.get<storage_experimental::TransferStallMinimumRateOption>())
253+
o.get<TransferStallMinimumRateOption>())
254254
.set<rest::MaximumCurlSocketRecvSizeOption>(
255255
o.get<MaximumCurlSocketRecvSizeOption>())
256256
.set<rest::MaximumCurlSocketSendSizeOption>(

google/cloud/storage/client_options_test.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,15 @@ TEST_F(ClientOptionsTest, MakeOptionsFromDefault) {
325325
EXPECT_EQ("test-project-id", opts.get<ProjectIdOption>());
326326
EXPECT_LT(0, opts.get<ConnectionPoolSizeOption>());
327327
EXPECT_LT(0, opts.get<DownloadBufferSizeOption>());
328-
EXPECT_LT(0,
329-
opts.get<storage_experimental::DownloadStallMinimumRateOption>());
328+
EXPECT_LT(0, opts.get<DownloadStallMinimumRateOption>());
330329
EXPECT_LT(0, opts.get<UploadBufferSizeOption>());
331330
EXPECT_LT(0, opts.get<MaximumSimpleUploadSizeOption>());
332331
EXPECT_TRUE(opts.has<EnableCurlSslLockingOption>());
333332
EXPECT_TRUE(opts.has<EnableCurlSigpipeHandlerOption>());
334333
EXPECT_EQ(0, opts.get<MaximumCurlSocketSendSizeOption>());
335334
EXPECT_EQ(0, opts.get<MaximumCurlSocketRecvSizeOption>());
336335
EXPECT_LT(0, opts.get<TransferStallTimeoutOption>().count());
337-
EXPECT_LT(0,
338-
opts.get<storage_experimental::TransferStallMinimumRateOption>());
336+
EXPECT_LT(0, opts.get<TransferStallMinimumRateOption>());
339337
EXPECT_THAT(opts.get<CARootsFilePathOption>(), IsEmpty());
340338
}
341339

@@ -364,19 +362,19 @@ TEST_F(ClientOptionsTest, DefaultOptions) {
364362
EXPECT_EQ(0, o.get<MaximumCurlSocketRecvSizeOption>());
365363
EXPECT_EQ(0, o.get<MaximumCurlSocketSendSizeOption>());
366364
EXPECT_LT(std::chrono::seconds(0), o.get<TransferStallTimeoutOption>());
367-
EXPECT_LT(0, o.get<storage_experimental::TransferStallMinimumRateOption>());
365+
EXPECT_LT(0, o.get<TransferStallMinimumRateOption>());
368366
EXPECT_LT(std::chrono::seconds(0), o.get<DownloadStallTimeoutOption>());
369-
EXPECT_LT(0, o.get<storage_experimental::DownloadStallMinimumRateOption>());
367+
EXPECT_LT(0, o.get<DownloadStallMinimumRateOption>());
370368

371369
namespace rest = ::google::cloud::rest_internal;
372370
EXPECT_EQ(o.get<rest::DownloadStallTimeoutOption>(),
373371
o.get<DownloadStallTimeoutOption>());
374372
EXPECT_EQ(o.get<rest::DownloadStallMinimumRateOption>(),
375-
o.get<storage_experimental::DownloadStallMinimumRateOption>());
373+
o.get<DownloadStallMinimumRateOption>());
376374
EXPECT_EQ(o.get<rest::TransferStallTimeoutOption>(),
377375
o.get<TransferStallTimeoutOption>());
378376
EXPECT_EQ(o.get<rest::TransferStallMinimumRateOption>(),
379-
o.get<storage_experimental::TransferStallMinimumRateOption>());
377+
o.get<TransferStallMinimumRateOption>());
380378
EXPECT_EQ(o.get<rest::MaximumCurlSocketRecvSizeOption>(),
381379
o.get<MaximumCurlSocketRecvSizeOption>());
382380
EXPECT_EQ(o.get<rest::MaximumCurlSocketSendSizeOption>(),

google/cloud/storage/internal/curl_request_builder.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@ CurlRequestBuilder& CurlRequestBuilder::ApplyClientOptions(
9797
http_version_ =
9898
std::move(options.get<storage_experimental::HttpVersionOption>());
9999
transfer_stall_timeout_ = options.get<TransferStallTimeoutOption>();
100-
transfer_stall_minimum_rate_ =
101-
options.get<storage_experimental::TransferStallMinimumRateOption>();
100+
transfer_stall_minimum_rate_ = options.get<TransferStallMinimumRateOption>();
102101
download_stall_timeout_ = options.get<DownloadStallTimeoutOption>();
103-
download_stall_minimum_rate_ =
104-
options.get<storage_experimental::DownloadStallMinimumRateOption>();
102+
download_stall_minimum_rate_ = options.get<DownloadStallMinimumRateOption>();
105103
return *this;
106104
}
107105

0 commit comments

Comments
 (0)