What is Time and Hit Count in ANTS Profiler

两盒软妹~` 提交于 2019-12-10 07:58:58

问题


I start to evaluate Red Gate's ANTS Profiler to profile my WPF application.

I read through the online support/documentation and can't seem to find explanation for the basics (and I don't know why they are not in the documentation):

In the profiler, it shows Time and Hit Count of Method. Why is Time has unit of %? Shouldn't it be second? I try to add up all the percentage but they don't add up to 100. The Time with Children has also unit in %, which adds up more than 100%. I cannot tell whether they are time or portion of something.

What is Hit Count? What is "hitting" my application and what hit is being count?

I know I sound very retarded, but without understanding Time and Hit Count I can't being reading the forum or online help.


回答1:


From the RedGate documentation:

The following data is shown for each method within the stack trace, for the selected time period:

Time: the total execution time for the method within this stack trace.

Time With Children: the total execution time for the method and all its children within this stack trace.

Hit Count: the number of times the method was called within this stack trace.




回答2:


Matthew's earlier answer is correct. To expand on it:

When you view time in percentages, the % time for each method represents the proportion of the total execution time for the selected period that the method contributed.

If you prefer to see time in seconds, click on View, then select Ticks, Milliseconds, or Seconds.

The total time can sum to more than 100% if you have more than one CPU.

The question about hit count is a bit more puzzling - it should indeed show how many times the method was called in the selected time period. If you're sure the hit count you're seeing is higher than it should be, it's probably worth contacting Red Gate support - support@red-gate.com .

I hope this helps!




回答3:


I haven't done all the calculations, but I think the time % is the average of one "hit" to the method. My guess is when you multiply the hit count with the Time% and sum them up, you get the 100%.

It would be the same with Time With Children but a lot more complex to calculate because you have to take into account many more methods.



来源:https://stackoverflow.com/questions/8454084/what-is-time-and-hit-count-in-ants-profiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!