Skip to content

Commit

Permalink
=metrics more precise emitting of pingRequest metrics (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso authored Oct 8, 2020
1 parent 2b66dc6 commit 3896fce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SWIMNIOExample/SWIMNIOShell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ public final class SWIMNIOShell {
// While this has a slight timing implication on time timeout of the pings -- the node that is last
// in the list that we ping, has slightly less time to fulfil the "total ping timeout"; as we set a total timeout on the entire `firstSuccess`.
// In practice those timeouts will be relatively large (seconds) and the few millis here should not have a large impact on correctness.
self.swim.metrics.shell.pingRequestResponseTimeFirst.recordInterval(since: startedSendingPingRequestsSentAt)
firstSuccessPromise.succeed(response)
}
case .failure(let error):
Expand All @@ -424,6 +423,7 @@ public final class SWIMNIOShell {
firstSuccessPromise.futureResult.whenComplete { result in
switch result {
case .success(let response):
self.swim.metrics.shell.pingRequestResponseTimeFirst.recordInterval(since: startedSendingPingRequestsSentAt)
self.receivePingRequestResponse(result: response, pingedPeer: target)

case .failure(let error):
Expand Down

0 comments on commit 3896fce

Please sign in to comment.