Class TimerEvent
- java.lang.Object
-
- com.google.cloud.tools.jib.event.events.TimerEvent
-
- All Implemented Interfaces:
JibEvent
public class TimerEvent extends java.lang.Object implements JibEvent
Timer event for timing various part of Jib's execution.Timer events follow a specific
TimerEvent.Timer
through aTimerEvent.State.START
,TimerEvent.State.LAP
, andTimerEvent.State.FINISHED
states. The duration indicates the duration since the lastTimerEvent
dispatched for theTimerEvent.Timer
.Timers can also define a hierarchy.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimerEvent.State
The state of the timing.static interface
TimerEvent.Timer
Defines a timer hierarchy.
-
Constructor Summary
Constructors Constructor Description TimerEvent(TimerEvent.State state, TimerEvent.Timer timer, java.time.Duration duration, java.time.Duration elapsed, java.lang.String description)
Creates a newTimerEvent
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Gets the description associated with this event.java.time.Duration
getDuration()
Gets the duration since the lastTimerEvent
for this timer.java.time.Duration
getElapsed()
Gets the total elapsed duration since this timer was created.TimerEvent.State
getState()
Gets the state of the timer.TimerEvent.Timer
getTimer()
Gets the timer this event is for.
-
-
-
Constructor Detail
-
TimerEvent
public TimerEvent(TimerEvent.State state, TimerEvent.Timer timer, java.time.Duration duration, java.time.Duration elapsed, java.lang.String description)
Creates a newTimerEvent
. For internal use only.- Parameters:
state
- the state of theTimerEvent.Timer
timer
- theTimerEvent.Timer
duration
- the lap durationelapsed
- the total elapsed time since the timer was createddescription
- the description of this event
-
-
Method Detail
-
getState
public TimerEvent.State getState()
Gets the state of the timer.- Returns:
- the state of the timer
- See Also:
TimerEvent.State
-
getTimer
public TimerEvent.Timer getTimer()
Gets the timer this event is for.- Returns:
- the timer
-
getDuration
public java.time.Duration getDuration()
Gets the duration since the lastTimerEvent
for this timer.- Returns:
- the duration since the last
TimerEvent
for this timer.
-
getElapsed
public java.time.Duration getElapsed()
Gets the total elapsed duration since this timer was created.- Returns:
- the duration since this timer was created
-
getDescription
public java.lang.String getDescription()
Gets the description associated with this event.- Returns:
- the description
-
-