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 Summary
Nested classes/interfaces inherited from interface org.apache.iceberg.metrics.Timer
Timer.Timed -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
count
public long count()Description copied from interface:TimerThe number of timesTimer.time(Duration)was called.- Specified by:
countin interfaceTimer- Returns:
- The number of times
Timer.time(Duration)was called.
-
totalDuration
Description copied from interface:TimerThe total duration that was recorded.- Specified by:
totalDurationin interfaceTimer- Returns:
- The total duration that was recorded.
-
start
Description copied from interface:TimerStarts the timer and returns aTimer.Timedinstance. CallTimer.Timed.stop()to complete the timing.- Specified by:
startin interfaceTimer- Returns:
- A
Timer.Timedinstance with the start time recorded.
-
record
Description copied from interface:TimerRecords a custom amount in the given time unit. -
time
Description copied from interface:TimerGets the result from the givenSupplierand measures its execution time. -
timeCallable
Description copied from interface:TimerExecutes and measures the givenCallableand returns its result. -
time
Description copied from interface:TimerExecutes and measures the givenRunnableinstance. -
unit
Description copied from interface:TimerTheTimeUnitof the timer. -
toString
-