Github user martin-g commented on a diff in the pull request:
https://github.com/apache/wicket/pull/166#discussion_r57284349
--- Diff:
wicket-experimental/wicket-metrics/src/main/java/org/apache/wicket/metrics/aspects/WicketFilterRequestCycleAspect.java
---
@@ -42,6 +44,35 @@
* might occur while invoking process request
*/
@Around("execution(*
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(..))")
+ public Object aroundRequestProcessedWithURL(ProceedingJoinPoint
joinPoint) throws Throwable
+ {
+ Object[] args = joinPoint.getArgs();
+ if (args.length >= 3)
+ {
+ Object requestAsObject = args[2];
+ if(requestAsObject instanceof HttpServletRequest){
+ HttpServletRequest httpServletRequest =
(HttpServletRequest)requestAsObject;
+ if (httpServletRequest != null)
+ {
+ return
measureTime("core/application/request/" +
httpServletRequest.getRequestURL().toString().replace("/", "_").replace(".",
"_").replace(":", ""), joinPoint,
--- End diff --
Split this in several lines/assignments.
Use `String#replace(char, char)` where possible.
Otherwise prefer Wicket-Util's `Strings#replace(CharSequence, CharSequence,
CharSequence)` than `String#replace(CharSequence, CharSequence)` because the
latter uses non-compiled Regex,
i.e. it is much slower.
---
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.
---