Package org.eclipse.jgit.logging
Class PerformanceLogContext
- java.lang.Object
-
- org.eclipse.jgit.logging.PerformanceLogContext
-
public class PerformanceLogContext extends java.lang.Object
Singleton that collects performance logs.- Since:
- 5.10
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<java.util.List<PerformanceLogRecord>>
eventRecords
List that stores events as performance logs.private static PerformanceLogContext
INSTANCE
Singleton instance that stores the statistics.
-
Constructor Summary
Constructors Modifier Constructor Description private
PerformanceLogContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEvent(PerformanceLogRecord record)
Adds a performance log record to the current list of events.void
cleanEvents()
Removes all of the existing records from the current list of events.java.util.List<PerformanceLogRecord>
getEventRecords()
Get the unmodifiable list of events as performance records.static PerformanceLogContext
getInstance()
Get the instance of the context.
-
-
-
Field Detail
-
INSTANCE
private static final PerformanceLogContext INSTANCE
Singleton instance that stores the statistics.
-
eventRecords
private static final java.lang.ThreadLocal<java.util.List<PerformanceLogRecord>> eventRecords
List that stores events as performance logs.
-
-
Method Detail
-
getInstance
public static PerformanceLogContext getInstance()
Get the instance of the context.- Returns:
- instance of performance log context.
-
getEventRecords
public java.util.List<PerformanceLogRecord> getEventRecords()
Get the unmodifiable list of events as performance records.- Returns:
- unmodifiable list of events as performance logs.
-
addEvent
public void addEvent(PerformanceLogRecord record)
Adds a performance log record to the current list of events.- Parameters:
record
- performance log record that is going to be added.
-
cleanEvents
public void cleanEvents()
Removes all of the existing records from the current list of events.
-
-