Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
Thank you Martin! Filed https://issues.apache.org/jira/browse/WICKET-5621 Hendy -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247p4666286.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
Hi, You are correct! It seems org.apache.wicket.response.filter.ServerAndClientTimeFilter and the other similar filters lie because they use the current request cycle's begin time. And as I said the processing time when there is a buffered response should be quite small. I agree that the reported time at the moment is not very useful. It seems we need to store more information to/with BufferedWebResponse to be able to cover the requirements in this mail thread and https://issues.apache.org/jira/browse/WICKET-5129. Please file a ticket. Martin Grigorov Wicket Training and Consulting On Tue, Jun 17, 2014 at 2:04 AM, Hendy Irawan wrote: > It seems ignoring BufferedResponseRequestHandler is harder than I thought > because IResponseFilter is only called during > BufferedResponseRequestHandler, not during the preceding > IPageRequestHandler. > > What is the best way to achieve my goal? i.e. during the begin and end of > IPageRequestHandler I need to perform tasks > (i.e. noting the start values, calculating the delta of values during > request processing, and then manipulate the response). > > for begin and end we have RequestCycleListener.onRequestHandlerResolved and > onEndRequest, but I don't know how to manipulate the response there (in > onEndRequest)?? > > The response manipulation is quite simple (adding dynamic JavaScripts > before > ) but I'd like to do it in CPU-efficient way if possible. > > Hendy > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247p4666282.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
It seems ignoring BufferedResponseRequestHandler is harder than I thought because IResponseFilter is only called during BufferedResponseRequestHandler, not during the preceding IPageRequestHandler. What is the best way to achieve my goal? i.e. during the begin and end of IPageRequestHandler I need to perform tasks (i.e. noting the start values, calculating the delta of values during request processing, and then manipulate the response). for begin and end we have RequestCycleListener.onRequestHandlerResolved and onEndRequest, but I don't know how to manipulate the response there (in onEndRequest)?? The response manipulation is quite simple (adding dynamic JavaScripts before ) but I'd like to do it in CPU-efficient way if possible. Hendy -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247p4666282.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
Thank you Martin. Currently I went with this solution: https://github.com/soluvas/soluvas-web/blob/3c3cb8a923e06522ccee156725196a8ab15fba0b/site/src/main/java/org/soluvas/web/site/metrics/ThreadMetricsRequestCycleListener.java I'll follow your advice and just ignored it, then :) Hendy -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247p4666252.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
Hi, Yes, ThreadLocal, request attribute and request cycle's metadata won't do it. You can store this data in the Session but you must be careful because you may have several requests (e.g. Ajax) in the same session simultaneously. Using the request parameters is also possible but then this data will be visible to your end users ... Yet another way (a bit more hidden) is to use a cookie but again you should be careful to not mix the data for two separate requests. You can also use the url from the second request (after the redirect) to extract which page would be responsible for it but this will add both CPU and memory to your end data. I think you can just ignore the requests that are handled by BufferedResponseRequestHandler. They are fast because they just write the buffered response (some markup in memory) to the http response. There is almost no processing here. Martin Grigorov Wicket Training and Consulting On Fri, Jun 13, 2014 at 10:51 AM, Hendy Irawan wrote: > I also tried requestCycle.setMetaData() but the metadata is also gone for > the > next related request. :( > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247p4666248.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
Hi, BufferedResponseRequestHandler just serves BufferedWebResponse instances, it doesn't know which page has generated for the buffered response. We already had another case, where this information would be valuable, see my last comment on https://issues.apache.org/jira/browse/WICKET-5129 Regards Sven On 06/13/2014 10:18 AM, Hendy Irawan wrote: Hi, How to get PageClass from BufferedResponseRequestHandler ? At little background: I'm sending processing metrics to Google Analytics, mentioning the PageClass (if available), used memory, and processing time. I'm using RequestCycleListener to do the crux of this. When Wicket's using IPageClassRequestHandler, things are fine. However, on the "second request" (after redirect to ?pageVersion), Wicket's using BufferedResponseRequestHandler, and I can't get the PageClass. A related question is how do I "link" related requests? Logically, I want this to happen: 1. User navigates to /contact 2. [http-thread-1] Begin RequestGroup -> sets starting mem usage, page class, etc. 3. [http-thread-1] page processing 4. Wicket redirects to /contact?0 5. [http-thread-2] page rendered 6. [http-thread-2] End RequestGroup -> calculates mem usage, etc. between #2..#6 I tried to use ThreadLocal but since thread is different, the information stored in step #2 is lost. Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
I also tried requestCycle.setMetaData() but the metadata is also gone for the next related request. :( -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247p4666248.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to get PageClass from BufferedResponseRequestHandler ? And how to "link" related requests?
Hi, How to get PageClass from BufferedResponseRequestHandler ? At little background: I'm sending processing metrics to Google Analytics, mentioning the PageClass (if available), used memory, and processing time. I'm using RequestCycleListener to do the crux of this. When Wicket's using IPageClassRequestHandler, things are fine. However, on the "second request" (after redirect to ?pageVersion), Wicket's using BufferedResponseRequestHandler, and I can't get the PageClass. A related question is how do I "link" related requests? Logically, I want this to happen: 1. User navigates to /contact 2. [http-thread-1] Begin RequestGroup -> sets starting mem usage, page class, etc. 3. [http-thread-1] page processing 4. Wicket redirects to /contact?0 5. [http-thread-2] page rendered 6. [http-thread-2] End RequestGroup -> calculates mem usage, etc. between #2..#6 I tried to use ThreadLocal but since thread is different, the information stored in step #2 is lost. Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-PageClass-from-BufferedResponseRequestHandler-And-how-to-link-related-requests-tp4666247.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org