[
https://issues.apache.org/jira/browse/WICKET-6128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15209939#comment-15209939
]
ASF GitHub Bot commented on WICKET-6128:
----------------------------------------
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.
> Add metrics for currently active sessions
> -----------------------------------------
>
> Key: WICKET-6128
> URL: https://issues.apache.org/jira/browse/WICKET-6128
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-metrics
> Affects Versions: 7.2.0, 8.0.0-M1
> Reporter: Martin Grigorov
> Assignee: Tobias Soloschenko
> Priority: Minor
> Fix For: 7.3.0, 8.0.0-M1
>
>
> Add metric for the number of currently active Wicket sessions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)