-
Notifications
You must be signed in to change notification settings - Fork 61
feat: add data model for client side metrics #1187
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
Open
daniel-sanche
wants to merge
107
commits into
main
Choose a base branch
from
csm_1_data_model
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
107 commits
Select commit
Hold shift + click to select a range
d2175f1
use replaceable channel wrapper
daniel-sanche 5e107fc
got unit tests working
daniel-sanche c4a97e1
put back in cache invalidation
daniel-sanche e71b1d5
added wrapped multicallables to avoid cache invalidation
daniel-sanche b81a9be
added crosssync, moved close logic back to client
daniel-sanche a1dffb5
generated sync code
daniel-sanche e3ec02b
got tests running
daniel-sanche 4e13783
fixed tests
daniel-sanche 7d90a04
remove extra wrapper; added invalidate_stubs helper
daniel-sanche 26cd601
fixed lint
daniel-sanche 375332f
fixed lint
daniel-sanche 428d75a
renamed replaceablechannel to swappablechannel
daniel-sanche 4b39bc5
added tests
daniel-sanche 3f090c2
added docstrings
daniel-sanche 883ceab
Merge branch 'main' into refactor_refresh
daniel-sanche 04c762a
initial commit
daniel-sanche 29dff4d
added back interceptor
daniel-sanche e4f8238
added metrics to client
daniel-sanche fcb062e
fixed lint
daniel-sanche ac8dbe4
Merge branch 'refactor_refresh' into csm_1_data_model
daniel-sanche d155f8a
set up channel interceptions
daniel-sanche 9fece96
added TrackedBackoffGenerator
daniel-sanche aec2577
fixed lint
daniel-sanche ec4e847
fixed import
daniel-sanche 8f99e4e
added operation.cancel
daniel-sanche f8e6603
added operation cancelled to interceptor
daniel-sanche f5e057e
gave each operation a uuid
daniel-sanche 8c397bb
return attempt metric on new attempt
daniel-sanche 2c34198
use standard context manager
daniel-sanche 9bd1e07
use default backoff generator
daniel-sanche 96d1355
require backoff; refactor check
daniel-sanche de5d07b
fixed context manager naming; lint
daniel-sanche d73f379
moved first_response_latency to operation
daniel-sanche a2070f9
Merge branch 'main' into refactor_refresh
daniel-sanche 4a4f80a
fixed import
daniel-sanche 5ea9f0e
Merge branch 'main' into csm_1_data_model
daniel-sanche 708a35a
fixed broken unit tests
daniel-sanche 67c08fd
Merge branch 'refactor_refresh' into csm_1_data_model
daniel-sanche 5ae7acc
added set_next to TrackedBackoffGenerator
daniel-sanche cb32296
added assertions to test_client
daniel-sanche f07e765
added new test metrics interceptor file
daniel-sanche a34c01e
first round of tests
daniel-sanche 84f61ee
added metadata capture for failed rpcs
daniel-sanche d4ae637
added test for starting attempts
daniel-sanche 1fbcadd
added sync tests
daniel-sanche edacd04
got tests passing
daniel-sanche c628d21
removed helper class
daniel-sanche 6d585ec
refactoring
daniel-sanche 01e6b36
refactored interceptor
daniel-sanche 05fe577
added unit tests for interceptor
daniel-sanche 4871abd
Merge branch 'main' into csm_1_data_model
daniel-sanche b6eac6c
fixed lint
daniel-sanche 07b3295
feat: added metrics interceptor
daniel-sanche e3ac131
pulled out operation logic
daniel-sanche 557b54a
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 3306ad7
fixed missing convert
daniel-sanche 65f15de
updated system test
daniel-sanche 16c5b6a
fixed lint
daniel-sanche 00cc52f
fixed annotation
daniel-sanche 019a8c2
Merge branch 'csm_interceptor' into csm_1_data_model
daniel-sanche 4ccfdab
removed duplicate import
daniel-sanche bd9ab70
added more tests
daniel-sanche 50b3e48
remove operation metadata key
daniel-sanche 2b35127
assign metadata directly
daniel-sanche 9cbda99
added test
daniel-sanche 73f4b3c
replace details mocks with real type
daniel-sanche d5e012d
strip operation id from metadata before request
daniel-sanche 486068b
added try; generated sync
daniel-sanche bb00b8b
re-generated sync classes; removed test
daniel-sanche c89f6d4
loosen test
daniel-sanche bebeb70
use contextvars
daniel-sanche 5ba2bbe
pulled in improvements to data model
daniel-sanche 4098fd9
removed cancel from spec
daniel-sanche 144d75e
broke out streaming wrapper into static function
daniel-sanche e8785ac
Merge branch 'csm_interceptor' into csm_1_data_model
daniel-sanche c1cc24d
fixed tests
daniel-sanche c433f3c
fixed lint
daniel-sanche 85d4cf0
Merge branch 'csm_interceptor' into csm_1_data_model
daniel-sanche ed9d3cf
fixed lint
daniel-sanche bc6036e
added close to metric spec
daniel-sanche 18ec330
fixed lint
daniel-sanche f1be54a
added test
daniel-sanche 9a33d86
Merge branch 'main' into csm_1_data_model
daniel-sanche e94e143
renamed methods
daniel-sanche 596e54e
improved from_context
daniel-sanche 16c8ed8
changed buffer time
daniel-sanche 4887830
ran blacken
daniel-sanche 5c80c79
use time mocks
daniel-sanche 8de4875
fixed lint
daniel-sanche 6a4d742
loosened test tolerances
daniel-sanche a474560
removed metrics superclass from interceptor
daniel-sanche 5390813
fixed lint
daniel-sanche 3e0d134
improved comments
daniel-sanche 6b48242
moved interceptor into _metrics
daniel-sanche dcf3d0a
pulled out tracking into new file
daniel-sanche c94e4ff
simplified wrapper method
daniel-sanche 3a87a35
Revert "moved interceptor into _metrics"
daniel-sanche b5c361b
moved tracked retry out of autogen folder
daniel-sanche 1b0b857
fixed typing
daniel-sanche ac315d0
added tests
daniel-sanche 87e78d1
removed unneeded imports
daniel-sanche 54b7208
ran blacken
daniel-sanche 819e1ae
Moved retry trackers into own file
daniel-sanche 22eb2e1
added docstring
daniel-sanche 0ec8d14
fixed type
daniel-sanche fa25c2b
import annotations
daniel-sanche f9ac548
Update google/cloud/bigtable/data/_metrics/data_model.py
daniel-sanche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Copyright 2023 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| from google.cloud.bigtable.data._metrics.metrics_controller import ( | ||
| BigtableClientSideMetricsController, | ||
| ) | ||
|
|
||
| from google.cloud.bigtable.data._metrics.data_model import ActiveOperationMetric | ||
| from google.cloud.bigtable.data._metrics.data_model import ActiveAttemptMetric | ||
| from google.cloud.bigtable.data._metrics.data_model import CompletedOperationMetric | ||
| from google.cloud.bigtable.data._metrics.data_model import CompletedAttemptMetric | ||
| from google.cloud.bigtable.data._metrics.data_model import OperationState | ||
| from google.cloud.bigtable.data._metrics.data_model import OperationType | ||
| from google.cloud.bigtable.data._metrics.tracked_retry import tracked_retry | ||
|
|
||
| __all__ = ( | ||
| "BigtableClientSideMetricsController", | ||
| "OperationType", | ||
| "OperationState", | ||
| "ActiveOperationMetric", | ||
| "ActiveAttemptMetric", | ||
| "CompletedOperationMetric", | ||
| "CompletedAttemptMetric", | ||
| "tracked_retry", | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
where is this called? Can you point me to the code location? It feels a bit weird that starting an attempt is called from an interceptor
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.
The implementation of this is here. The wrapper is executed before each intercept_unary_unary call.
The main purpose of this is to add the
operationargument to this method, since that's not part of the regular intercept_unary_unary signature.But yeah, there is a line to start an attempt if the associated rpc wasn't started previously. I can't remember if that was actually needed, or if I added that as a safeguard. I'll look into it