Skip to content

Commit 2145a23

Browse files
authored
fix: fix the metric bucketing issue (GoogleCloudPlatform#3277)
* fix: fix the metric bucketing issue * Fix the issue.
1 parent 79bcdd9 commit 2145a23

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • src/main/java/com/google/cloud/spanner/pgadapter/utils

src/main/java/com/google/cloud/spanner/pgadapter/utils/Metrics.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ public class Metrics {
3636

3737
public static List<Double> getMetricLatencyMillisBuckets() {
3838
final int MAX_NUM_FINITE_BUCKETS = 50;
39-
final double BASE = 1.25;
40-
final double SCALE_FACTOR = 0.25;
39+
final double BASE = 0.25;
40+
final double SCALE_FACTOR = 1.25;
4141
final double MAX_VALUE = 600;
42-
double bucketValue = SCALE_FACTOR;
42+
double bucketValue = BASE;
4343

4444
List<Double> rpcMillisBucketBoundaries = new ArrayList<Double>(MAX_NUM_FINITE_BUCKETS);
4545
for (int i = 0; i < MAX_NUM_FINITE_BUCKETS && bucketValue <= MAX_VALUE; i++) {
4646
rpcMillisBucketBoundaries.add(bucketValue);
47-
bucketValue = SCALE_FACTOR * BASE;
47+
bucketValue *= SCALE_FACTOR;
4848
}
4949
return rpcMillisBucketBoundaries;
5050
}

0 commit comments

Comments
 (0)