Something that comes up when speaking to FusionReactor customers is the need to handle long running requests. In FusionReactor as with many APM solutions there is a continuous running aggregate of the average run-time of the web requests.
Unfortunately if you have a single request that has to run for a long time it can cause this number to become skewed; essentially the average run-time of requests can end up being longer than it really is just because of this one request e.g. often a maintenance job run by the system admins, which is not so important when you are interested in real user experience.
Scenario 1 – Excluding a single long running request which is skewing performance metrics
Let us assume you have a running web application, in this instance running on a tomcat server. Now let’s assume that you have a request that is run via this application as some routine job. This job typically runs over a minute and has a negative affect on the average run-time of your server. We would like this request to be ignored by FusionReactor and not included in the metrics calculated, but every other request should continue to be tracked.
The goal is to eliminate this request from the metrics, and get a better picture of what the overall performance of the server is.
Using this example URL for the job: /JTA/performance/jdbc/jdbc30secondrating.jsp
Outcome – we’re keeping it real 🙂
At this point FusionReactor will now be ignoring the request that you have added to the restrictions, and will no longer be included it in the metrics for the server. This will hopefully improve the rating of the server among your peers as it will now seem that by magic the server is performing better.
Scenario 2 – Using regex to exclude multiple tasks affecting your server performance rating
Similar to the previous scenario, but this time we have a whole sub section of the application that is only used by the system administrators to affect changes on the database, or perform clean up tasks.
Lets us imagine that we have a number of administrative tasks, such as account merge, account removal etc. These are not performed that often, but never the less do take some time. These requests can then affect the overall statistics of the server, making it seem busier or less efficient than it actually is.
The goal here is to identify these administrative tasks and remove them from the request tracking. We can identify these requests as they have the string /system/admin/ in the URL. This being the root of all the system administrator tasks that we want to ignore. Once approach would be to enter all the URLs one by one in the same way we did above. The disadvantage is that if new jobs would be entered, we would need to remember to include the individual URL. A much better approach is to use the “Regular Expression” strategy to ignore all the requests by using a single rule.
Regex, or Regular Expressions, are a very powerful tool for any language. However just like many, many things in programming the implementation of regex can vary from language to language. FusionReactor uses the Java regex engine. Plenty of documentation on the Java regex exists, here are a few links: FR quick list, Oracle Docs, online Java regex evaluator