cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Difference between Self time and total time

rajan.d.panchal
Wanderer

what is difference between a self time and total time taken ?

when I hover over self-time it says : the amount of time taken in this method only and does not include time spent on any method it called" . What does this mean? 

Any method in code is combination of other method calls so I dont know what self-time represents?

 

Any explanation?

3 REPLIES 3

Pratik.Maskey
AppDynamics Team (Retired)

Hi,

 

If you refer to call graph self-time is the total time taken for the lines executed within the method and total time represents the time taken for all the invocations within the method (including other method calls).

You can expand the call graph further for the one showing total time.

Self-time is the time taken by a method for all the lines of code within it and excluding the time taken by any other methods which were called inside it.
Total time is the time taken by a method for all the lines of code within it and including the time taken by any other methods called inside it.

e.g.

public void methodA() {
code line 1 -> took 1 ms
methodB() - took 5 ms
code line 2 -> took 1 ms
}

methodA self-time would be 2 ms (time for code line 1 + code line 2)
methodA total time would be 7 ms (if not expanded this will show up, self-time + methodB time)
methodB self-time would be 5 ms

 

Thanks



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

I have this following method:

 

public ResultSet executeQuery() throws SQLException {
checkOpen();
try {
return DelegatingResultSet.wrapResultSet(this,((PreparedStatement)_stmt).executeQuery());
}
catch (SQLException e) {
handleException(e);
throw new AssertionError();
}
}

The report shows line 764 which part of the another method not show here. But the method that is called at 764 is shown above. 

line number.JPGselftotal.JPG

 

AppD says self time of this method is 150ms and total time of this method is 150ms. There only method calls in this. so what took the self time?  or the self time is the time of the method that called executeQuery( In this case the method that has line 764)

 

 

 

Pratik.Maskey
AppDynamics Team (Retired)

The self time and total time are treated as separate if its the last call or there is no sub call( JDBC call or HTTP service call). In your case, the 150 ms is the time taken to execute the call (the other lines of code) including the query execution time.

 

The execution time will be the total of all the self time.Screen Shot 2018-03-06 at 7.12.10 PM.pngScreen Shot 2018-03-06 at 7.13.20 PM.png



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.