Skip to content

Commit

Permalink
fixed an issue where statistics were not updating as intended.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Oct 27, 2024
1 parent 0326b07 commit 2f07d2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Network/NetworkMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public final actor NetworkMonitor {
currentBytesInPerSecond: currentBytesInPerSecond,
currentBytesOutPerSecond: currentBytesOutPerSecond
)
defer {
previousQueueBytesOut.removeFirst()
}
if measureInterval <= previousQueueBytesOut.count {
defer {
previousQueueBytesOut.removeFirst()
}
var total = 0
for i in 0..<previousQueueBytesOut.count - 1 where previousQueueBytesOut[i] < previousQueueBytesOut[i + 1] {
total += 1
Expand Down

0 comments on commit 2f07d2d

Please sign in to comment.