Package org.apache.iceberg.metrics
Class DefaultTimer
java.lang.Object
org.apache.iceberg.metrics.DefaultTimer
- All Implemented Interfaces:
- Timer
A default 
Timer implementation that uses a Stopwatch instance internally to
 measure time.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.iceberg.metrics.TimerTimer.Timed
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionlongcount()The number of timesTimer.time(Duration)was called.voidRecords a custom amount in the given time unit.start()Starts the timer and returns aTimer.Timedinstance.voidExecutes and measures the givenRunnableinstance.<T> TGets the result from the givenSupplierand measures its execution time.<T> TtimeCallable(Callable<T> callable) Executes and measures the givenCallableand returns its result.toString()The total duration that was recorded.unit()TheTimeUnitof the timer.
- 
Constructor Details- 
DefaultTimer
 
- 
- 
Method Details- 
countpublic long count()Description copied from interface:TimerThe number of timesTimer.time(Duration)was called.- Specified by:
- countin interface- Timer
- Returns:
- The number of times Timer.time(Duration)was called.
 
- 
totalDurationDescription copied from interface:TimerThe total duration that was recorded.- Specified by:
- totalDurationin interface- Timer
- Returns:
- The total duration that was recorded.
 
- 
startDescription copied from interface:TimerStarts the timer and returns aTimer.Timedinstance. CallTimer.Timed.stop()to complete the timing.- Specified by:
- startin interface- Timer
- Returns:
- A Timer.Timedinstance with the start time recorded.
 
- 
recordDescription copied from interface:TimerRecords a custom amount in the given time unit.
- 
timeDescription copied from interface:TimerGets the result from the givenSupplierand measures its execution time.
- 
timeCallableDescription copied from interface:TimerExecutes and measures the givenCallableand returns its result.
- 
timeDescription copied from interface:TimerExecutes and measures the givenRunnableinstance.
- 
unitDescription copied from interface:TimerTheTimeUnitof the timer.
- 
toString
 
-