Package overit.geocall.util.tracer
Class StartEndTracer
java.lang.Object
overit.geocall.util.tracer.MemoryTracer
overit.geocall.util.tracer.StartEndTracer
- All Implemented Interfaces:
Serializable,Tracer
This class extends the abstract class
This tracer put in the register the first
Usually the
MemoryTracer and creates an instance
of the tracer. This tracer put in the register the first
'n/2' rows and the last 'n/2' rows, where 'n'
is the value of the parameter passed to the constructor StartEndTracer(maxSize).Usually the
'maxSize' corresponds to the value ThreadContext.MAX_MEMORY_TRACE_SIZE.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intFields inherited from class overit.geocall.util.tracer.MemoryTracer
_maxSize, _time -
Constructor Summary
ConstructorsConstructorDescriptionStartEndTracer(int maxSize) Class constructor using the first parameter to determine the maximum registry length.
The maximum length will be splitted in two equals part, so the first rows will be placed in the registry up to half the maximum length and the same thing for the last rows. -
Method Summary
Methods inherited from class overit.geocall.util.tracer.MemoryTracer
makeTracer
-
Field Details
-
_maxPartSize
protected int _maxPartSize -
_head
-
_tail
-
_tailStart
protected int _tailStart
-
-
Constructor Details
-
StartEndTracer
public StartEndTracer(int maxSize) Class constructor using the first parameter to determine the maximum registry length.
The maximum length will be splitted in two equals part, so the first rows will be placed in the registry up to half the maximum length and the same thing for the last rows.- Parameters:
maxSize- Maximum registry length.
-
-
Method Details
-
getRegistry
Return theArrayListcalled"registry"containing all the records of the log.- Specified by:
getRegistryin classMemoryTracer- Returns:
- The
ArrayListcontains all the records of the log.
-
record
Adds a record of log to the registry. -
stop
public void stop()Method to call when the execution is finished. Takes care of calculating the execution time as a delta between the start and end processing time. -
getTraceTime
public long getTraceTime()Return the time of the execution. If thestop()has not been called, the value returned will be 0.- Specified by:
getTraceTimein interfaceTracer- Returns:
- The time of the execution.
-