mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +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.
|
||||
*/
|
||||
// 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 {
|
||||
// TODO: Determine an appropriate limit and also enforce in the network parameters and the transaction builder.
|
||||
private const val maxAllowedInputsAndReferences = 10_000
|
||||
|
@ -62,6 +62,7 @@ import org.apache.activemq.artemis.utils.ReusableLatch
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.slf4j.MDC
|
||||
import java.time.Duration
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class FlowPermissionException(message: String) : FlowException(message)
|
||||
@ -333,6 +334,9 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
||||
|
||||
logger.debug { "Calling flow: $logic" }
|
||||
val startTime = System.nanoTime()
|
||||
serviceHub.monitoringService.metrics
|
||||
.timer("Flows.StartupQueueTime")
|
||||
.update(Duration.ofNanos(startTime).toMillis() - creationTime, TimeUnit.MILLISECONDS)
|
||||
var initialised = false
|
||||
val resultOrError = try {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user