Package com.lightbend.cinnamon.stopwatch
Class StopwatchBlocks
- java.lang.Object
-
- com.lightbend.cinnamon.stopwatch.StopwatchBlocks
-
- All Implemented Interfaces:
Stopwatch
- Direct Known Subclasses:
Timekeeper
public abstract class StopwatchBlocks extends java.lang.Object implements Stopwatch
Default implementations of Stopwatchwrap
andstart
.
-
-
Constructor Summary
Constructors Constructor Description StopwatchBlocks()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activate(java.lang.String name)
Start a stopwatch where subsequent operations in the current asynchronous scope will propagate the stopwatch; such as within the scope of an Akka Stream operator.abstract void
add(java.lang.String name)
abstract void
remove(java.lang.String name)
void
start(java.lang.String name, java.lang.Runnable runnable)
Start a stopwatch where the operations in the runnable will propagate the stopwatch.<T> T
start(java.lang.String name, scala.Function0<T> body)
Start a stopwatch where the operations in the block will propagate the stopwatch.void
wrap(java.lang.String name, java.lang.Runnable runnable)
Run the runnable within a stopwatch start and end, to create a user defined time interval.<T> T
wrap(java.lang.String name, scala.Function0<T> body)
Run the block within a stopwatch start and stop, to create a user defined time interval.
-
-
-
Method Detail
-
activate
public void activate(java.lang.String name)
Description copied from interface:Stopwatch
Start a stopwatch where subsequent operations in the current asynchronous scope will propagate the stopwatch; such as within the scope of an Akka Stream operator. The matching stopwatch stop operation will create a user defined time interval. A user defined stopwatch may start and stop in any location in the asynchronous flow, i.e. it may span over several actors, futures, or streams.
-
add
public abstract void add(java.lang.String name)
-
remove
public abstract void remove(java.lang.String name)
-
start
public <T> T start(java.lang.String name, scala.Function0<T> body)
Description copied from interface:Stopwatch
Start a stopwatch where the operations in the block will propagate the stopwatch. The matching stopwatch stop operation will create a user defined time interval. A user defined stopwatch may start and stop in any location in the asynchronous flow, i.e. it may span over several actors, futures, or streams.
-
start
public void start(java.lang.String name, java.lang.Runnable runnable)
Description copied from interface:Stopwatch
Start a stopwatch where the operations in the runnable will propagate the stopwatch. The matching stopwatch stop operation will create a user defined time interval. A user defined stopwatch may start and stop in any location in the asynchronous flow, i.e. it may span over several actors, futures, or streams.
-
wrap
public <T> T wrap(java.lang.String name, scala.Function0<T> body)
Description copied from interface:Stopwatch
Run the block within a stopwatch start and stop, to create a user defined time interval.
-
wrap
public void wrap(java.lang.String name, java.lang.Runnable runnable)
Description copied from interface:Stopwatch
Run the runnable within a stopwatch start and end, to create a user defined time interval.
-
-