mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
[JSON-API] Add metrics for ledger command submission timing (#10076)
changelog_begin - [JSON-API] Timing metrics which measure how long the processing of a command submission request takes on the ledger are now available changelog_end
This commit is contained in:
parent
7eb2ce72a9
commit
1f5aa4491c
@ -217,7 +217,10 @@ class Endpoints(
|
||||
_ <- EitherT.pure(parseAndDecodeTimerCtx.close())
|
||||
|
||||
ac <- eitherT(
|
||||
handleFutureEitherFailure(commandService.create(jwt, jwtPayload, cmd))
|
||||
Timed.future(
|
||||
metrics.daml.HttpJsonApi.commandSubmissionLedgerTimer,
|
||||
handleFutureEitherFailure(commandService.create(jwt, jwtPayload, cmd)),
|
||||
)
|
||||
): ET[domain.ActiveContract[ApiValue]]
|
||||
} yield ac
|
||||
}
|
||||
@ -241,8 +244,11 @@ class Endpoints(
|
||||
resolvedCmd = cmd.copy(argument = apiArg, reference = resolvedRef)
|
||||
|
||||
resp <- eitherT(
|
||||
handleFutureEitherFailure(
|
||||
commandService.exercise(jwt, jwtPayload, resolvedCmd)
|
||||
Timed.future(
|
||||
metrics.daml.HttpJsonApi.commandSubmissionLedgerTimer,
|
||||
handleFutureEitherFailure(
|
||||
commandService.exercise(jwt, jwtPayload, resolvedCmd)
|
||||
),
|
||||
)
|
||||
): ET[domain.ExerciseResponse[ApiValue]]
|
||||
|
||||
@ -261,8 +267,11 @@ class Endpoints(
|
||||
_ <- EitherT.pure(parseAndDecodeTimerCtx.close())
|
||||
|
||||
resp <- eitherT(
|
||||
handleFutureEitherFailure(
|
||||
commandService.createAndExercise(jwt, jwtPayload, cmd)
|
||||
Timed.future(
|
||||
metrics.daml.HttpJsonApi.commandSubmissionLedgerTimer,
|
||||
handleFutureEitherFailure(
|
||||
commandService.createAndExercise(jwt, jwtPayload, cmd)
|
||||
),
|
||||
)
|
||||
): ET[domain.ExerciseResponse[ApiValue]]
|
||||
} yield resp
|
||||
|
@ -731,6 +731,9 @@ final class Metrics(val registry: MetricRegistry) {
|
||||
val dbFindByContractKey: Timer = registry.timer(Prefix :+ "db_find_by_contract_key_timing")
|
||||
// Meters how long a find by contract id database operation takes
|
||||
val dbFindByContractId: Timer = registry.timer(Prefix :+ "db_find_by_contract_id_timing")
|
||||
// Meters how long processing of the command submission request takes on the ledger
|
||||
val commandSubmissionLedgerTimer: Timer =
|
||||
registry.timer(Prefix :+ "command_submission_ledger_timing")
|
||||
// Meters http requests throughput
|
||||
val httpRequestThroughput: Meter = registry.meter(Prefix :+ "http_request_throughput")
|
||||
// Meters how many websocket connections are currently active
|
||||
|
Loading…
Reference in New Issue
Block a user