hyperdrive-profiler 2.2.0 → 2.2.2

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 +4 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -86,6 +86,9 @@ const cmd = command('hyperdrive-profiler',
86
86
  timestampsInfo += `\n - Blobs core: ${blobsContig} / ${blobsLength} (contiguous length / length)`
87
87
  if (secTillFullyDownload) timestampsInfo += `\n - Fully downloaded in ${secTillFullyDownload.toFixed(2)} seconds`
88
88
 
89
+ timestampsInfo += `\n - Nr peers db core: ${drive.db.core.peers.length} `
90
+ if (drive.blobs) timestampsInfo += `\n - Nr peers blobs core: ${drive.blobs.core.peers.length} `
91
+
89
92
  let remoteLength = 0
90
93
  let remoteContiguousLength = 0
91
94
  let blobRemoteLength = 0
@@ -260,7 +263,7 @@ async function printRemotesInfo (drive, remotes) {
260
263
  }
261
264
 
262
265
  console.info(' - Blobs core:')
263
- for (const p of drive.blobs.core.replicator.peers) {
266
+ for (const p of drive.blobs?.core?.replicator.peers || []) {
264
267
  const pubKey = IdEnc.normalize(p.remotePublicKey)
265
268
  if (remotes.includes(pubKey)) {
266
269
  const done = p.remoteLength > 0 && p.remoteContiguousLength === p.remoteLength
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperdrive-profiler",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Profile hyperdrive download performance",
5
5
  "main": "index.js",
6
6
  "scripts": {