-
Notifications
You must be signed in to change notification settings - Fork 7
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
Async Metrics #4661
Async Metrics #4661
Conversation
Generate changelog in
|
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.
I think the semantics are good, just a few stylistic comments.
atlasdb-client/src/main/java/com/palantir/atlasdb/util/AtlasDbMetrics.java
Show resolved
Hide resolved
atlasdb-client/src/main/java/com/palantir/atlasdb/util/TaggedMetricsInvocationEventHandler.java
Show resolved
Hide resolved
atlasdb-client/src/main/java/com/palantir/atlasdb/util/TaggedMetricsInvocationEventHandler.java
Outdated
Show resolved
Hide resolved
atlasdb-client/src/main/java/com/palantir/atlasdb/util/TaggedMetricsInvocationEventHandler.java
Show resolved
Hide resolved
atlasdb-client/src/test/java/com/palantir/atlasdb/util/AtlasDbMetricsTest.java
Outdated
Show resolved
Hide resolved
atlasdb-client/src/test/java/com/palantir/atlasdb/util/AtlasDbMetricsTest.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.
Goals (and why):
As part of some of the conjure-undertow changes, async versions of requests were added. The sad part is, the metrics as we know currently are off since they measure the time it takes to be given back the
ListenableFuture
vs how long theListenableFuture
takes to complete.Ideally this would go in https://github.com/palantir/tritium, but given that we've hacked together the
TaggedMetricsInvocationHandler
for our own (nefarious?) gains, I didn't want to unwind that change as I'm working on Timelock Partitioning etc. @schlosna for SA. My proposed impl would be that it goes inByteBuddyInstrumentationAdvice
orInvocationEventProxy
then everyInvocationHandler
gets async metrics stuff for free!Implementation Description (bullets):
TaggedMetricsInvocationHandler
wrt metric name cache etc. Since the metric name doesn't change for most invocations we're wasting time doing the string concat and the allocations forMetricName
. For the ones with the extra tags, have a specialised cache for those calls.ListenableFuture
and if so, add alistener
that will update the metric. Otherwise we leave it as is.Testing (What was existing testing like? What have you done to improve it?):
Concerns (what feedback would you like?):
Where should we start reviewing?:
TaggedMetricsEventInvocationHandler
AtlasDbMetrics
Priority (whenever / two weeks / yesterday):
ASAP! Some metrics in our internal dashboard is a lie until fixed.