Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 51c296f

Browse files
author
Ian Sturdy
authored
Increase Stackdriver CreateTimeSeries batch size. (#127)
1 parent 95f2066 commit 51c296f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

opencensus/exporters/stats/stackdriver/internal/stackdriver_e2e_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,9 @@ TEST_F(StackdriverE2eTest, LargeTest) {
224224
count_matchers;
225225

226226
// The number of values to record for each tag--total metric cardinality will
227-
// be tag_values^2.
228-
const int tag_values = 10;
227+
// be tag_values^2. We want this high enough that uploads require multiple
228+
// batches.
229+
const int tag_values = 25;
229230
for (int i = 0; i < tag_values; ++i) {
230231
for (int j = 0; j < tag_values; ++j) {
231232
const std::string tag1 = absl::StrCat("v1", i);

opencensus/exporters/stats/stackdriver/internal/stackdriver_exporter.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ namespace {
3131

3232
constexpr char kGoogleStackdriverStatsAddress[] = "monitoring.googleapis.com";
3333
constexpr char kProjectIdPrefix[] = "projects/";
34-
constexpr int kTimeSeriesBatchSize = 3;
34+
// Stackdriver limits a single CreateTimeSeries request to 200 series.
35+
constexpr int kTimeSeriesBatchSize = 200;
3536

3637
std::string ToString(const grpc::Status& status) {
3738
return absl::StrCat("status code ", status.error_code(), " details \"",

0 commit comments

Comments
 (0)