Github user klopfdreh commented on the pull request:
https://github.com/apache/wicket/pull/164#issuecomment-217837350
> Strange, because AspectJ manipulates/instruments classes with a behavior
which is not needed in a system which do not use metrics. AspectJ and javassist
use the same way to operate: instrumenting of code.
If you let away any AspectJ jars and the dependency to wicket-metrics -
wicket-core behaves like before. If you add the AspectJ jars and the dependency
to wicket-metrics - the aspects are weaved around the method / constructor
calls and the metrics are created. (This is an advantage of the agent usage)
> There is not need to compile core classes: we are profiling custom app
and not core. So the main target for instrumenting, should be custom code, but
not core themselves. There is quite thin boundary: if you check my code - it's
dynamically overrides core methods in a custom class. So even pure Page's core
methods can be profiled.
That is not right in general. Imagine the circumstances that the user has a
lot of AjaxLinks and override the onClick mechanism within an anonymous inner
class. The code is implemented by a customer, but the class is provided by
wicket-core and because of this also core classes would be needed to be
manipulate.
Also if you want to measure the request time, you have to consolidate core
classes.
> And one more point: I wouldn't say that injection is key point for
profiler. Last one should be transparent for application's logic. So profiler
should not change application's fields, arguments and etc. It should be one
level up.
That is not a good idea. One requirement was to log the actual request
which reached the server (also with url):
https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-metrics/src/main/java/org/apache/wicket/metrics/aspects/request/WicketFilterRequestCycleUrlAspect.java#L54
This would not be possible anymore if you do it the way you suggested.
> Btw, I have question regarding AspectJ implementation: java agents has
ability to be attached remotely to a working java processes.
http://docs.oracle.com/javase/6/docs/technotes/guides/attach/index.html
> Is it a case for AspectJ? If it's a case: using agent become actually a
good pro.
I didn't had a look at the attach API yet, but it would be a great
advantage if you could setup your own "metrics logging server" indeed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---