A ExecutionRecord recorder for a block execution. A block is some code that produces a result and may throw exceptions.
Modifiers | Name | Description |
---|---|---|
class |
Recorder.Block |
Abstraction of a block of code that produces a result of type T and may throw exceptions. |
class |
Recorder.Property |
Free formed name/value property pair that will be saved along the execution record for a particular block. |
Type | Name and description |
---|---|
long |
allocationRecordId() Allocate a new recordId that can be used to create a ExecutionRecord and record an execution span. |
void |
closeRecord(ExecutionRecord record) Closes an execution span measurement using the allocated record id obtained from allocationRecordId() method. |
T |
record(ExecutionType executionType, Block<T> block, Recorder.Property... properties) Records the time elapsed while executing a Block and saves the resulting ExecutionRecord to ProcessRecorder. |
Allocate a new recordId that can be used to create a ExecutionRecord and record an execution span. This method is useful when the code span to measure cannot be expressed as a Block and therefore cannot directly use the record(ExecutionType, Block, Property...) method.
Closes an execution span measurement using the allocated record id obtained from allocationRecordId() method.
record
- the span execution record, fully populated.Records the time elapsed while executing a Block and saves the resulting ExecutionRecord to ProcessRecorder.
executionType
- the task type, so aggregation can be performed.block
- the block of code to execution and measure.properties
- optional list of free formed properties to save in the ExecutionRecord
- the type of the returned value from the block.