-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add evaluateAt support for probe instrumentations #4320
Conversation
92e7a17
to
281f012
Compare
case EXIT: | ||
return Snapshot.MethodLocation.EXIT; | ||
} | ||
return null; |
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.
Will this become a NPE in the caller?
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.
hmmm no, why?
|
||
protected LabelNode getReturnHandler(AbstractInsnNode exitNode) { | ||
// exit node must have been removed from the original instruction list | ||
assert exitNode.getNext() == null && exitNode.getPrevious() == null; |
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.
Assertions aren't enabled by default, right?
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.
no, only if you enable with -ea
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.
Soo, this is redundant because nobody enables assertions?
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.
removing...
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.
How about replacing with a IllegalArgumentException
?
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.
looks good. some questions regarding metrics
} | ||
} | ||
|
||
@Override | ||
protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { | ||
return callMetric(metricProbe); |
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.
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.
would we be able to add condition for metrics in this fashion as well?
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.
@@ -290,6 +295,12 @@ public enum Kind { | |||
AFTER; | |||
} | |||
|
|||
public enum MethodLocation { | |||
NONE, |
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 find the name and value confusing.
evalautAt = None means evaluate both at entry and exit for snapshot but entry for metric and logs (I think). maybe change it to DEFAULT or use null to indicate there is nothing there.
Also suggest to rename to EvalauteAtLocation not confusing with method inside ProbleLocation.
* Snapshot: indicates for method probe where conditions are evaluated before serializing data. Either at entry or exit of the method. * Metric: indicates for method probe where the metric is emitted and with which values. For example at Exit of the method you can emit the return value of the method. * Log: use the same mechanism than snapshot but can report for example at exit of the method the return value.
53f4bc4
to
3e0b9c9
Compare
3e0b9c9
to
b184e07
Compare
What Does This Do
Motivation
following #4313
Additional Notes