public final class ResponseTimes extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clears the global response time collection
|
static ResponseTime |
collect(ResponseTime responseTime)
Collects a completed ResponeTime recording.
|
static ResponseTime |
collect(String transaction,
TimeMeasure result)
Collects a completed time measure for a specific transaction.
|
static Map<String,List<ResponseTime>> |
getResponseTimes()
Returns all recorded response times.
|
static void |
onMeasureEnd(Consumer<ResponseTime> responseTimeConsumer)
Overrides the default consumer that handles response times on the end of a transaction
|
static void |
onMeasureStart(Consumer<ResponseTime> responseTimeConsumer)
Overrides the default consumer that handles response times on the beginning of a transaction
|
static void |
resetResponseTimeHandlers()
Resets the response time consumer to the default.
|
static ResponseTime |
startTx(String transaction)
Starts a transaction on the specified point in time
|
static ResponseTime |
startTx(String transaction,
Instant start)
Starts a transaction on the specified point in time
|
static ResponseTime |
stopTx(ResponseTime finish)
Records the response time as finished.
|
public static void clear()
public static void resetResponseTimeHandlers()
public static void onMeasureStart(Consumer<ResponseTime> responseTimeConsumer)
responseTimeConsumer - the consumer to process response timespublic static void onMeasureEnd(Consumer<ResponseTime> responseTimeConsumer)
responseTimeConsumer - the consumer to process response timespublic static ResponseTime startTx(String transaction)
transaction - the transaction to startpublic static ResponseTime startTx(String transaction, Instant start)
transaction - the transaction to startstart - the point in time when the transaction startedpublic static ResponseTime stopTx(ResponseTime finish)
finish - the response time of the finished transaction. If the response time denotes no finished transaction, it
is finished now.public static ResponseTime collect(ResponseTime responseTime)
responseTime - the responseTime to collect into the global collection.public static ResponseTime collect(String transaction, TimeMeasure result)
transaction - the transaction to be associated with the time measureresult - a time measure result to associate with the transactionpublic static Map<String,List<ResponseTime>> getResponseTimes()
Copyright © 2016 DevCon5 GmbH. All rights reserved.