You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by klopfdreh <gi...@git.apache.org> on 2016/03/23 19:24:33 UTC
[GitHub] wicket pull request: WICKET-6128 / WICKET-6127 - Request url / Ses...
GitHub user klopfdreh opened a pull request:
https://github.com/apache/wicket/pull/166
WICKET-6128 / WICKET-6127 - Request url / Session count measurement
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/klopfdreh/wicket further_measurements
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/166.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #166
----
commit 9ec8c94bdc00ff7d5fce043a7a0a5032f893075c
Author: Tobias Soloschenko <ts...@apache.org>
Date: 2016-03-23T18:17:49Z
WICKET-6128 / WICKET-6127 - Request url / Session count measurement
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request: WICKET-6128 / WICKET-6127 - Request url / Ses...
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the pull request:
https://github.com/apache/wicket/pull/166#issuecomment-200732877
Hi Martin,
thanks for reviewing. I am going to convert the replace to char only - are you able to test the metrics within your project? I did already and they were working for me.
I thought that a HttpSessionListener is the best choice for the session count - but if metadata-complete is set to true you have to configure the listener yourself.
The fallback from Application.get() > Application.get(String) > static members are completely configurable.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request: WICKET-6128 / WICKET-6127 - Request url / Ses...
Posted by martin-g <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request: WICKET-6128 / WICKET-6127 - Request url / Ses...
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the pull request:
https://github.com/apache/wicket/pull/166#issuecomment-200724411
:+1:
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request: WICKET-6128 / WICKET-6127 - Request url / Ses...
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the pull request:
https://github.com/apache/wicket/pull/166#issuecomment-201007248
Integrated:
master: https://github.com/apache/wicket/commit/50b6cadc5d44a45c261f599501cac20b5c20c766
wicket-7.x: https://github.com/apache/wicket/commit/20c3b9982dffbb265bb176439414622169b1533a
@martin-g - One thing which has to be done so that the measurement of the session is working correctly is to clear the session storage from disc after restarting the server, because otherwise stored session leads to negative session counts, because they are restored and expire.
There is no good solution to handle this out of the box by the servlet API, because anywhere you persist the information about a session count it can be erased. (tmp folder, realPath(), etc.)
I made a hint into the guide. I also removed the jsessionid from the path of the request measurement.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request: WICKET-6128 / WICKET-6127 - Request url / Ses...
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh closed the pull request at:
https://github.com/apache/wicket/pull/166
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---