Hi James and Mujtaba Chohan. I found the solution for this.
The difference is huge because the wall clock is calculating the actual time where as sum(endtime - starttime) is calculating the sum of the differences. When it comes to difference, most of the readBlock traces will take nano seconds. There is a small fraction of readBlock traces which end up with the gap of 1 millisecond.
This the code segment which assigns start and end time.
builder.addCounter(Interns.info(START.traceName, EMPTY_STRING), span.getStartTimeMillis());
builder.addCounter(Interns.info(END.traceName, EMPTY_STRING), span.getStopTimeMillis());
The solution is to store the nanotime. This will eventually lead to get rid of round of errors which we are actually facing now. It will not change the DDL of Tracing table, but the content will be nanotime.