log.error(iae);
continue;
}
// Now compute the adjusted data, which is what we will report back to the server.
CallTimeDataValue previousValue = (previousRawCallTimeData != null) ? previousRawCallTimeData.getValues()
.get(methodName) : null;
boolean supercedesPrevious = ((previousValue != null) && (previousValue.getBeginTime() == lastResetTime
.getTime()));
Date beginTime = lastResetTime;
if (supercedesPrevious) {
// The data for this method hasn't been reset since the last time we collected it.
long countSincePrevious = count - previousValue.getCount();
if (countSincePrevious > 0) {
// There have been new calls since the last time we collected data
// for this method. Adjust the time span to begin at the end of the
// time span from the previous collection.
beginTime = new Date(previousValue.getEndTime());
// Adjust the total and count to reflect the adjusted time span;
// do so by subtracting the previous values from the current values.
// NOTE: It isn't possible to figure out the minimum and maximum for
// the adjusted time span, so just leave them be. If they happen
// to have changed since the previous collection, they will be
// accurate; otherwise they will not.
count = countSincePrevious;
totalTime = totalTime - (long) previousValue.getTotal();
}
// else, the count hasn't changed, so don't bother adjusting the data;
// when the JON server sees the data has the same begin time as
// previously persisted data, it will replace the previous data with the
// updated data (which will basically have a later end time)