Skip to content

Commit

Permalink
feat(2981): middleware stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
koekiebox committed Nov 20, 2024
1 parent f80bdec commit 9195b7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function createBalanceMiddleware(): ILPMiddleware {
}: ILPContext,
next: () => Promise<void>
): Promise<void> => {
const stopTimer = services.telemetry.startTimer('balanceMiddleware', {
callName: 'balanceMiddleware'
const stopTimer = services.telemetry.startTimer('balance_middleware_next', {
callName: 'balanceMiddleware:next'
})
const { amount } = request.prepare
const logger = services.logger.child(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export function createIncomingErrorHandlerMiddleware(
): ILPMiddleware {
return async (ctx: ILPContext, next: () => Promise<void>): Promise<void> => {
const stopTimer = ctx.services.telemetry.startTimer(
'createIncomingErrorHandlerMiddleware',
'create_incoming_error_handler_middleware_next',
{
callName: 'createIncomingErrorHandlerMiddleware'
callName: 'createIncomingErrorHandlerMiddleware:next'
}
)
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ export function createStreamAddressMiddleware(): ILPMiddleware {
{ request, services: { streamServer, telemetry }, state }: ILPContext,
next: () => Promise<void>
): Promise<void> => {
const stopTimer = telemetry.startTimer('createStreamAddressMiddleware', {
callName: 'createStreamAddressMiddleware'
})
const stopTimer = telemetry.startTimer(
'create_stream_address_middleware_decode_tag',
{
callName: 'createStreamAddressMiddleware:decodePaymentTag'
}
)
const { destination } = request.prepare
// To preserve sender privacy, the accountId wasn't included in the original destination address.
state.streamDestination = streamServer.decodePaymentTag(destination)
Expand Down

0 comments on commit 9195b7c

Please sign in to comment.