Skip to content

Commit

Permalink
πŸ”‰ add monitoring on resume
Browse files Browse the repository at this point in the history
  • Loading branch information
bcaudan committed Aug 29, 2022
1 parent 4e28db2 commit 82c719f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/transport/sendWithRetryStrategy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { addTelemetryDebug } from '../domain/telemetry'
import { monitor } from '../tools/monitor'
import { ONE_KILO_BYTE, ONE_MEGA_BYTE, ONE_SECOND } from '../tools/utils'
import type { Payload, HttpResponse } from './httpRequest'
Expand Down Expand Up @@ -42,6 +43,11 @@ function scheduleRetry(state: RetryState, sendStrategy: SendStrategy) {
send(payload, state, sendStrategy, {
onSuccess: () => {
state.queuedPayloads.dequeue()
addTelemetryDebug('resuming after intake failure', {
currentBackoffTime: state.currentBackoffTime,
queuedPayloadCount: state.queuedPayloads.size(),
queuedPayloadBytesCount: state.queuedPayloads.bytesCount,
})
state.currentBackoffTime = ONE_SECOND
sendNextPayload(state, sendStrategy)
},
Expand Down

0 comments on commit 82c719f

Please sign in to comment.