mirror of
https://github.com/corda/corda.git
synced 2025-02-22 10:10:59 +00:00
AG-323 Flow startup queue metric (#6811)
This commit is contained in:
parent
5a13e48ea8
commit
2c25a5c768
@ -29,7 +29,11 @@ import java.time.Duration
|
|||||||
* @param etaThreshold If the ETA for processing the request, according to the service, is greater than this, notify the client.
|
* @param etaThreshold If the ETA for processing the request, according to the service, is greater than this, notify the client.
|
||||||
*/
|
*/
|
||||||
// See AbstractStateReplacementFlow.Acceptor for why it's Void?
|
// See AbstractStateReplacementFlow.Acceptor for why it's Void?
|
||||||
abstract class NotaryServiceFlow(val otherSideSession: FlowSession, val service: SinglePartyNotaryService, private val etaThreshold: Duration) : FlowLogic<Void?>(), IdempotentFlow {
|
abstract class NotaryServiceFlow(
|
||||||
|
val otherSideSession: FlowSession,
|
||||||
|
val service: SinglePartyNotaryService,
|
||||||
|
private val etaThreshold: Duration
|
||||||
|
) : FlowLogic<Void?>(), IdempotentFlow {
|
||||||
companion object {
|
companion object {
|
||||||
// TODO: Determine an appropriate limit and also enforce in the network parameters and the transaction builder.
|
// TODO: Determine an appropriate limit and also enforce in the network parameters and the transaction builder.
|
||||||
private const val maxAllowedInputsAndReferences = 10_000
|
private const val maxAllowedInputsAndReferences = 10_000
|
||||||
|
@ -62,6 +62,7 @@ import org.apache.activemq.artemis.utils.ReusableLatch
|
|||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import org.slf4j.MDC
|
import org.slf4j.MDC
|
||||||
|
import java.time.Duration
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class FlowPermissionException(message: String) : FlowException(message)
|
class FlowPermissionException(message: String) : FlowException(message)
|
||||||
@ -333,6 +334,9 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
|||||||
|
|
||||||
logger.debug { "Calling flow: $logic" }
|
logger.debug { "Calling flow: $logic" }
|
||||||
val startTime = System.nanoTime()
|
val startTime = System.nanoTime()
|
||||||
|
serviceHub.monitoringService.metrics
|
||||||
|
.timer("Flows.StartupQueueTime")
|
||||||
|
.update(Duration.ofNanos(startTime).toMillis() - creationTime, TimeUnit.MILLISECONDS)
|
||||||
var initialised = false
|
var initialised = false
|
||||||
val resultOrError = try {
|
val resultOrError = try {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user