I have a Purepath that runs the same method multiple times. Each time it passes it a different arguement. A simplified example is this... Purepath CalculateRevenue calls method "Calculate" multiple times passing it arguement values like "ConsultingRevenue", "ProductSalesRevenue" and "OtherRevenue". Each time it is called, it calculates revenue for that argument value.
PP - CalculateRevenue
Calculate("ConsultingRevenue")
Calculate("ProductSalesRevenue")
Calculate("OtherRevenue")
I want to monitor how long EACH call to "Calculate" takes. I'd like to use it to build a Dashlet and report that averages calls to "Calculate" like below
Method Call Executions Time
ConsultingRevenue 393 1935ms
ProductSalesRevenue 393 1902ms
OtherRevenue 393 4930ms
I have spent a long time trying different types of measures/splitting values etc. I've also tried following some of the advice on this forum to no avail. I can split the calls to the method by arguement value ok. But I can't get it to tell me how long each method call is taking. I always either get the purepath response time or the measure I put in the "Caluclate Results" section of the Buisiness Transaction returns nothing.
I have attached a screen shot of the response time I'm looking to capture for each time the method is called.
What I'm asking here is how do I build a Business Transaction that calculates the Time Spent on a method split by method arguement value.
Thanks in advance for your help.
--Frank
Answer by Frank P. ·
We've got this working now. Hopefully this will be useful to other folks searching the forums for help. This was a definite need for us and I'm thankful to this forum (Rob especially) for helping to get this working. Hopefully Dynatrace will make this a bit more intuitive in future versions of the product. At least in our company we expected the Avg Time to calculate with the method execution time and not the entire Purepath time. Also, make sure that you choose "Reanalyze Purepaths" after you finish modifying the transaction.
Answer by Rob V. ·
Hi Frank,
Working together via email I believe we've got you set, though I agree it's not the most intuitive thing ever.
Here's a cleansed image based on the session you sent to me via email: one PP, with 5 calls to a method using 5 different values for arg 1, with ExecTime values computed per arg value. I edited the BT to get the results you wanted:
Here's a wrap-up for the forum.
The key was to create a "Calculate Results" return value/measure for the BT. This return value should be the same as the "Split" BT criterion. That is, it will be a "Business Transaction Evaluation/Filter/Grouping Values - Argument Value" measure. Just exactly like the splitting measure, to start off with.
The difference is that you need continue on to the "Details" tab of that measure definition, go all the way to the bottom, open up the section that says "Transaction", select "Grouping value", and pick the value of interest - in our case "Exec Time":
After doing that, we're now able to compute different Exec Times for the same methods executed multiple times on the same PP, grouped by an argument to that method, as shown in the image above.
Whew.
Rob
Rob/Frank
Can you include the screen shot of the Configuration Tab for the BT. Did you specify anything in the Argument Value?
Thanks
Rajesh
Hi Rajesh,
No, you don't do anything special in the Argument Value field on the configuration of the BT. You leave it blank, which means "take anything".
In case it helps, here's a shell of the System Profile that has only an example BT similar to this one in it. This is based on our demo system easyTravel, so if you have that you should be able to copy the one sensor and the BT from it, and paste them into your easyTravel System Profile. This way you can work with something live.
Here is the sample SP: MethodTimeByArgValue_BT.profile.xml
Rob
Answer by Andreas G. ·
Frank. Is it possible to export one of your PurePaths and send it over to me? Either attach it to this forum or send it to me via email
I replied to the email that came to my email box from your reply to this forum. I'm not sure if it got to you. If it didn't make it to you, can you email me at frank.punzo@thehartford.com? I'll reply to that with the .dts file. I don't want to post it into a forum. Thanks. --Frank
Answer by Rob V. ·
Hi Frank,
I wish I could help you out, but creating a measure or business transaction for tracking the execution time of a particular method, conditional on the value of one of its arguments, isn't possible. I'd be happy to be wrong here, but I don't think I am.
As you noted, you can get close by splitting on the argument, but then you end up with PurePath time, or execution time of all invocations of your target method, but not with the execution times differentiated by the argument value.
If it's critical for you to get this info, there is a way to do it. As an easy way where you don't have to change the Calculate code, you could create a new "wrapper" method called CalculateWrapper with the same signature as Calculate and replace your calls to Calculate with calls to CalculateWrapper. In that wrapper method, you check your string argument and call a specialized method (like CalculateConsultingRevenue), which then does nothing more than call Calculate("ConsultingRevenue"). Now you can have measures that track all of the indivual specialized methods, and you'll know how much time is being spent on each one, and how many times they're being called.
I hope this helps some,
Rob
Hey Rob,
Thanks for the reply. Unfortunately changing the application isn't an option for us. It's a vendor purchased app.
I'd be happy to take a deeper look as well. If you could forward me the PP that you sent to Andi I'll look further.
I replied to the email that came to my email box from your reply to this forum. I'm not sure if it got to you. If it didn't make it to you, can you email me at frank.punzo@thehartford.com? I'll reply to that with the .dts file. I don't want to post it into a forum. Thanks. --Frank
JANUARY 15, 3:00 PM GMT / 10:00 AM ET