-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update tracers to use built in metrics #1244
Conversation
25d61e5
to
ca28be6
Compare
db124f2
to
8a2aa0e
Compare
...loud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...ain/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerStreamingCallable.java
Outdated
Show resolved
Hide resolved
...ain/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerStreamingCallable.java
Outdated
Show resolved
Hide resolved
...ain/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerStreamingCallable.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerFactory.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java
Outdated
Show resolved
Hide resolved
38b2804
to
353aeb7
Compare
...ud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
a198247
to
82e63f0
Compare
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerFactory.java
Outdated
Show resolved
Hide resolved
.../main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...oud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracer.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
statsRecorderWrapper)); | ||
|
||
final long applicationLatency = 200; | ||
final AtomicInteger counter = new AtomicInteger(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this atomic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, because it's used in response observer so it needs to be final, and I also need to update the value, so i need to AtomicInteger here?
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
assertThat(zone.getAllValues()).containsExactly(UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED); | ||
assertThat(cluster.getAllValues()).containsExactly(UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED); | ||
assertThat(status.getAllValues()).containsExactly("UNAVAILABLE", "UNAVAILABLE", "OK", "OK"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a test that checks what happens when a retry attempt changes cluster/zone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be! In my next pr :)
...e/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
🤖 I have created a release *beep* *boop* --- ## [2.9.0](v2.8.0...v2.9.0) (2022-06-30) ### Features * add built-in metric constants ([#1243](#1243)) ([b1fc00a](b1fc00a)) * **generated:** Add storage_utilization_gib_per_node to Autoscaling target ([a4c6621](a4c6621)) * **generated:** Cloud Bigtable Undelete Table service and message proto files ([a4c6621](a4c6621)) * update tracers to use built in metrics ([#1244](#1244)) ([df77560](df77560)) ### Bug Fixes * fix flaky test ([#1293](#1293)) ([146c824](146c824)) * remove the shaded profile from root pom ([#1274](#1274)) ([5eafcc3](5eafcc3)) * rename HeaderTracer callables to BigtableTracer callables ([#1276](#1276)) ([e0bd6c9](e0bd6c9)) * rename response observer and callbacks ([#1291](#1291)) ([2705a47](2705a47)) ### Documentation * **sample:** update README for native image sample ([#1281](#1281)) ([4a3a2c9](4a3a2c9)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#1285](#1285)) ([1dc7787](1dc7787)) * update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 ([#1283](#1283)) ([ba7844a](ba7844a)) * update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 ([#1284](#1284)) ([75d0066](75d0066)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* feat: add built in metrics measure and views * remove status from application latency * Rename methods and add comments * update based on comments * feat: update tracers to use built in metrics * update on comments * make stopwatch thread safe * update comments * calculate application latency correctly * remove unused check * clean up tests * fix typo * update test * fix flaky test * fix retry count
🤖 I have created a release *beep* *boop* --- ## [2.9.0](v2.8.0...v2.9.0) (2022-06-30) ### Features * add built-in metric constants ([#1243](#1243)) ([b1fc00a](b1fc00a)) * **generated:** Add storage_utilization_gib_per_node to Autoscaling target ([a4c6621](a4c6621)) * **generated:** Cloud Bigtable Undelete Table service and message proto files ([a4c6621](a4c6621)) * update tracers to use built in metrics ([#1244](#1244)) ([df77560](df77560)) ### Bug Fixes * fix flaky test ([#1293](#1293)) ([146c824](146c824)) * remove the shaded profile from root pom ([#1274](#1274)) ([5eafcc3](5eafcc3)) * rename HeaderTracer callables to BigtableTracer callables ([#1276](#1276)) ([e0bd6c9](e0bd6c9)) * rename response observer and callbacks ([#1291](#1291)) ([2705a47](2705a47)) ### Documentation * **sample:** update README for native image sample ([#1281](#1281)) ([4a3a2c9](4a3a2c9)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#1285](#1285)) ([1dc7787](1dc7787)) * update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 ([#1283](#1283)) ([ba7844a](ba7844a)) * update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 ([#1284](#1284)) ([75d0066](75d0066)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.