-
Notifications
You must be signed in to change notification settings - Fork 22
Tx manager tracer #187
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
base: main
Are you sure you want to change the base?
Tx manager tracer #187
Conversation
f330c02
to
5b47768
Compare
5b47768
to
a40fcb2
Compare
} | ||
} | ||
} catch (Exception e) { | ||
tracer.onException(); |
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.
tracer.onException(e)
will be more extensible
} | ||
} | ||
results.labels(name, "fail").inc(); | ||
tracer.onRetryExceeded(); |
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.
Same as onException(e), onRetryExceeded(e) will offer more extensibility
import java.util.concurrent.atomic.AtomicReference; | ||
import java.util.function.Supplier; | ||
|
||
import static java.lang.String.format; |
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.
This import is unused, please remove it (Checkstyle)
public ReadonlyBuilder withStatementIsolationLevel(IsolationLevel isolationLevel) { | ||
Preconditions.checkArgument(isolationLevel.isReadOnly(), | ||
"readOnly() can only be used with a read-only tx isolation level, but got: %s", isolationLevel); | ||
"readOnly() can only be used with a read-only tx isolation level, but got: %s", isolationLevel |
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.
Minor whitespace change. I'd leave it as-is instead
import java.util.function.Consumer; | ||
import java.util.function.Supplier; | ||
|
||
public interface StdTxManagerTracer { |
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.
Let's make the interface part of StdTxManagerTracer an interface inside StdTxManager, like TracerFactory.
And the Tracer implementations will be in separate class(es), as they are now.
No description provided.