hyperswarm-stats 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -21,7 +21,7 @@ class HyperswarmStats {
21
21
  this._packetsReceivedOverClosedSwarmStreams += conn.rawStream?.packetsReceived || 0
22
22
  this._retransmitsOfClosedSwarmStreams += conn.rawStream?.retransmits
23
23
  this._fastRecoveriesOfClosedSwarmStreams += conn.rawStream?.fastRecoveries
24
- this._rtoCountOfClosedSwarmStreams += conn.rawStream?.rtoCount
24
+ this._rtoCountOfClosedSwarmStreams += conn.rawStream?.lifetimeRtoCount || 0
25
25
  })
26
26
  }
27
27
 
@@ -84,7 +84,7 @@ class HyperswarmStats {
84
84
  getRTOCountAcrossAllStreams() {
85
85
  let countFromCurrentConns = 0
86
86
  for (const conn of this.swarm.connections) {
87
- countFromCurrentConns += conn.rawStream?.rtoCount || 0
87
+ countFromCurrentConns += conn.rawStream?.lifetimeRtoCount || 0
88
88
  }
89
89
 
90
90
  return countFromCurrentConns + this._rtoCountOfClosedSwarmStreams
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperswarm-stats",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Hyperswarm stats with prometheus support",
5
5
  "main": "index.js",
6
6
  "scripts": {