• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
  • Home /
  • Public Forums /
  • Application Monitoring & UEM /
  • AppMon & UEM Open Q&A /
avatar image
Question by Satish P. · Sep 09, 2012 at 11:20 AM · diagnostics

.net collections - performance problems - auto sensors?

some good and bad news.. DT 4.1 helped quickly identify a performance issue in our code.. we were using System.Collections.Arraylists, and then doing an Arraylist.IndexOf()

Arraylist.IndexOf():

The ArrayList <http://msdn.microsoft.com/en-us/library/system.collections.arraylist(v=vs.100).aspx> is searched forward starting at the first element and ending at the last element.

This method performs a linear search; therefore, this method is an O(thumbs down) operation, where n is Count

what is curious is i had to scan my source code to find the issue.. ie my MethodA() uses ArrayList.IndexOf.. DT only reported long execution time and high-cpu on this method.. but didn't further explode the root cause.

I was hoping the auto sensor would have shown System.Collections.Arraylist.IndexOf being responsible.. why didnt it?

Comment

People who like this

0 Show 0
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Reply

  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image

Answer by Andreas G. · Sep 10, 2012 at 02:01 PM

Hi

I assume that the individual calls to IndexOf didnt take as long as the code executed in your MethodA handling the individual array elements. Auto Sensors do not look at every single method execution. Auto Sensors will pick up methods that have a high execution time. If your IndexOf method is called very often but an individual execution is very fast it will most likely not identify it as a problem but rather identify the calling method.
You can learn more on how Auto Sensors work by watching our recent dynaLearn Webinar on Sensors: dynaLearn Webinar - Advanced Sensor Rules - September 5, 2012

Its good to hear that you found the problem in the end. Also - it is great input for us to hear about a use case like yours. Helps us improve the product to automatically detect problem patterns like the one you described

Andi

Comment

People who like this

0 Show 2 · Share
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Satish P. · Sep 11, 2012 at 03:54 AM 0
Share

Hi Andi,

the individual calls to ArrayList.indexOf() was responsible for 99% of the execution time in MethodA().. as soon as the code was corrected to remove the ArrayList.IndexOf() call, MethodA() now runs under 10ms.. before it would take over a second depending on the size of the Arraylist.. as the documentation explain, IndexOf uses a linear search which is very expensive.

Hence the confusion as to why ArrayList.IndexOf wasn't auto-profiled.

Actually thinking about it some more.. MethodA() was called by another method, say ProcessCode(). While i had ProcessCode() explicitly instrumented in a sensor package, MethodA() was NOT being shown in the purepath even though it was responsible for 99% of the execution time.. i had to explicitly instrument Method() to determine root cause.. which still didn't reveal the .net collection to be responsible.

Hence the concern / confusion that auto-sensors don't seem to work.

The weird behavior now is that since the time we have fixed MethodA().. it doesn't show up in the purepath anymore, even though it is still part of the sensor rules.. i dont see it in  the "Methods" dashlet either. Exploring the configured sensors on the agent shows that the method is no longer instrumented.. sometimes when i restart the process, it gets instrumented.. most times, it does not.. very weird behavior.

Definitely looks like a product bug..

avatar image Andreas G. ♦ Satish P. · Sep 11, 2012 at 01:54 PM 0
Share

That is definitely interesting. Here are some thoughts

a) In case you use dynaTrace 4.2: in the PurePath Dashlet click on "Show all Nodes" - see if that gives you additional visibility. By default we only show "Relevant" nodes, e.g: we hide deep stacks and only show "leave" methods that have a performance significance
b) As for the Sensors that don't work: Have you checked the Deployed Sensor Tab in the Agent Overview? This will show you which methods are actually instrumented. It also shows you which Sensor Group/Pack defines the Rule.

As you explain a very "volatile" behavior I suggest you open a support ticket. When looking at your sessions we will be able to find the root cause of this. It might be a product bug - or hopefully something that can easily be explained

Thanks

Andi

How to get started

First steps in the forum
Read Community User Guide
Best practices of using forum

NAM 2019 SP5 is available


Check the RHEL support added in the latest NAM service pack.

Learn more

LIVE WEBINAR

"Performance Clinic - Monitoring as a Self Service with Dynatrace"


JANUARY 15, 3:00 PM GMT / 10:00 AM ET

Register here

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

OQL on Memory Leak Analysis

APPMON vs HP Diagnostics

analyzing high number of page faults

XML parser exceptions

Server deployment incidents, AppMon server

Forum Tags

dotnet mobile monitoring load iis 6.5 kubernetes mainframe rest api dashboard framework 7.0 appmon 7 health monitoring adk log monitoring services auto-detection uem webserver test automation license web performance monitoring ios nam probe collector migration mq web services knowledge sharing reports window java hybris javascript appmon sensors good to know extensions search 6.3+ server documentation easytravel web dashboard kibana system profile purelytics docker splunk 6.1 process groups account 7.2 rest dynatrace saas spa guardian appmon administration production user actions postgresql upgrade oneagent measures security Dynatrace Managed transactionflow technologies diagnostics user session monitoring unique users continuous delivery sharing configuration alerting NGINX splitting business transaction client 6.3 installation database scheduler apache mobileapp RUM php dashlet azure purepath agent 7.1 appmonsaas messagebroker nodejs 6.2 android sensor performance warehouse
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A