@peerbit/stream 5.1.5 → 5.2.0
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.
- package/dist/src/index.d.ts +13 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +80 -15
- package/dist/src/index.js.map +1 -1
- package/package.json +7 -6
- package/src/index.ts +100 -20
- package/dist/benchmark/chunk-transfer.d.ts +0 -2
- package/dist/benchmark/chunk-transfer.d.ts.map +0 -1
- package/dist/benchmark/chunk-transfer.js +0 -221
- package/dist/benchmark/chunk-transfer.js.map +0 -1
- package/dist/benchmark/directstream-sim.d.ts +0 -12
- package/dist/benchmark/directstream-sim.d.ts.map +0 -1
- package/dist/benchmark/directstream-sim.js +0 -299
- package/dist/benchmark/directstream-sim.js.map +0 -1
- package/dist/benchmark/index.d.ts +0 -11
- package/dist/benchmark/index.d.ts.map +0 -1
- package/dist/benchmark/index.js +0 -54
- package/dist/benchmark/index.js.map +0 -1
- package/dist/benchmark/topology-sim.d.ts +0 -12
- package/dist/benchmark/topology-sim.d.ts.map +0 -1
- package/dist/benchmark/topology-sim.js +0 -410
- package/dist/benchmark/topology-sim.js.map +0 -1
- package/dist/benchmark/transfer.d.ts +0 -2
- package/dist/benchmark/transfer.d.ts.map +0 -1
- package/dist/benchmark/transfer.js +0 -251
- package/dist/benchmark/transfer.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -1221,8 +1221,18 @@ export type PublishOptions = (WithMode | WithTo) &
|
|
|
1221
1221
|
PriorityOptions &
|
|
1222
1222
|
ResponsePriorityOptions &
|
|
1223
1223
|
ExpiresAtOptions &
|
|
1224
|
+
ExpiresInOptions &
|
|
1224
1225
|
WithExtraSigners;
|
|
1225
1226
|
|
|
1227
|
+
/**
|
|
1228
|
+
* Sets an expiry relative to the timestamp captured in the signed message
|
|
1229
|
+
* header. This avoids caller-side clock drift between computing an absolute
|
|
1230
|
+
* expiry and constructing the header.
|
|
1231
|
+
*/
|
|
1232
|
+
export type ExpiresInOptions = {
|
|
1233
|
+
expiresInMs?: number;
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1226
1236
|
export abstract class DirectStream<
|
|
1227
1237
|
Events extends { [s: string]: any } = StreamEvents,
|
|
1228
1238
|
>
|
|
@@ -1266,6 +1276,7 @@ export abstract class DirectStream<
|
|
|
1266
1276
|
private prunedConnectionsCache?: Cache<string>;
|
|
1267
1277
|
private pruneToLimitsInFlight?: Promise<void>;
|
|
1268
1278
|
private _startInFlight?: Promise<void>;
|
|
1279
|
+
private _stopInFlight?: Promise<void>;
|
|
1269
1280
|
private routeMaxRetentionPeriod: number;
|
|
1270
1281
|
private routeCacheMaxFromEntries?: number;
|
|
1271
1282
|
private routeCacheMaxTargetsPerFrom?: number;
|
|
@@ -1545,8 +1556,11 @@ export abstract class DirectStream<
|
|
|
1545
1556
|
}
|
|
1546
1557
|
|
|
1547
1558
|
async start() {
|
|
1559
|
+
// Do not queue a restart behind teardown; callers can retry after stop resolves.
|
|
1560
|
+
if (this._stopInFlight) return;
|
|
1548
1561
|
if (this.started) return;
|
|
1549
1562
|
if (this._startInFlight) return this._startInFlight;
|
|
1563
|
+
this.stopping = false;
|
|
1550
1564
|
this._startInFlight = this._startImpl().finally(() => {
|
|
1551
1565
|
this._startInFlight = undefined;
|
|
1552
1566
|
});
|
|
@@ -1669,7 +1683,6 @@ export abstract class DirectStream<
|
|
|
1669
1683
|
}
|
|
1670
1684
|
|
|
1671
1685
|
this.started = true;
|
|
1672
|
-
this.stopping = false;
|
|
1673
1686
|
logger.trace("starting");
|
|
1674
1687
|
|
|
1675
1688
|
// Incoming streams
|
|
@@ -1780,11 +1793,50 @@ export abstract class DirectStream<
|
|
|
1780
1793
|
/**
|
|
1781
1794
|
* Unregister the pubsub protocol and the streams with other peers will be closed.
|
|
1782
1795
|
*/
|
|
1783
|
-
|
|
1784
|
-
if (
|
|
1785
|
-
|
|
1796
|
+
stop(): Promise<void> {
|
|
1797
|
+
if (this._stopInFlight) return this._stopInFlight;
|
|
1798
|
+
if (!this.started && !this._startInFlight) return Promise.resolve();
|
|
1799
|
+
this.stopping = true;
|
|
1800
|
+
const starting = this._startInFlight;
|
|
1801
|
+
this._stopInFlight = this._stopAfterStart(starting).finally(() => {
|
|
1802
|
+
this.stopping = false;
|
|
1803
|
+
this._stopInFlight = undefined;
|
|
1804
|
+
});
|
|
1805
|
+
return this._stopInFlight;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
private async _stopAfterStart(starting?: Promise<void>): Promise<void> {
|
|
1809
|
+
let startFailed = false;
|
|
1810
|
+
let startFailure: unknown;
|
|
1811
|
+
try {
|
|
1812
|
+
await starting;
|
|
1813
|
+
} catch (error) {
|
|
1814
|
+
startFailed = true;
|
|
1815
|
+
startFailure = error;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
let stopFailed = false;
|
|
1819
|
+
let stopFailure: unknown;
|
|
1820
|
+
if (this.started) {
|
|
1821
|
+
try {
|
|
1822
|
+
await this._stopImpl();
|
|
1823
|
+
} catch (error) {
|
|
1824
|
+
stopFailed = true;
|
|
1825
|
+
stopFailure = error;
|
|
1826
|
+
}
|
|
1786
1827
|
}
|
|
1787
1828
|
|
|
1829
|
+
if (startFailed && stopFailed) {
|
|
1830
|
+
throw new AggregateError(
|
|
1831
|
+
[startFailure, stopFailure],
|
|
1832
|
+
"DirectStream start and rollback stop failed",
|
|
1833
|
+
);
|
|
1834
|
+
}
|
|
1835
|
+
if (stopFailed) throw stopFailure;
|
|
1836
|
+
if (startFailed) throw startFailure;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
private async _stopImpl(): Promise<void> {
|
|
1788
1840
|
const sharedState = this.sharedRoutingState;
|
|
1789
1841
|
const sharedKey = this.sharedRoutingKey;
|
|
1790
1842
|
|
|
@@ -1876,7 +1928,6 @@ export abstract class DirectStream<
|
|
|
1876
1928
|
}
|
|
1877
1929
|
}
|
|
1878
1930
|
logger.trace("stopped");
|
|
1879
|
-
this.stopping = false;
|
|
1880
1931
|
}
|
|
1881
1932
|
|
|
1882
1933
|
isStarted() {
|
|
@@ -2030,6 +2081,10 @@ export abstract class DirectStream<
|
|
|
2030
2081
|
* Registrar notifies a closing connection with pubsub protocol
|
|
2031
2082
|
*/
|
|
2032
2083
|
protected async onPeerDisconnected(peerId: PeerId, conn?: Connection) {
|
|
2084
|
+
if (this.stopping || !this.started) {
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2033
2088
|
// PeerId could be me, if so, it means that I am disconnecting
|
|
2034
2089
|
const peerKey = getPublicKeyFromPeerId(peerId);
|
|
2035
2090
|
const peerKeyHash = peerKey.hashcode();
|
|
@@ -2056,6 +2111,9 @@ export abstract class DirectStream<
|
|
|
2056
2111
|
}
|
|
2057
2112
|
if (!this.publicKey.equals(peerKey)) {
|
|
2058
2113
|
await this._removePeer(peerKey);
|
|
2114
|
+
if (this.stopping || !this.started) {
|
|
2115
|
+
return;
|
|
2116
|
+
}
|
|
2059
2117
|
|
|
2060
2118
|
// tell dependent peers that there is a node that might have left
|
|
2061
2119
|
const dependent = this.routes.getDependent(peerKeyHash);
|
|
@@ -2064,15 +2122,19 @@ export abstract class DirectStream<
|
|
|
2064
2122
|
this.removePeerFromRoutes(peerKeyHash, true);
|
|
2065
2123
|
|
|
2066
2124
|
if (dependent.length > 0) {
|
|
2125
|
+
const goodbye = await new Goodbye({
|
|
2126
|
+
leaving: [peerKeyHash],
|
|
2127
|
+
header: new MessageHeader({
|
|
2128
|
+
session: this.session,
|
|
2129
|
+
mode: new SilentDelivery({ to: dependent, redundancy: 2 }),
|
|
2130
|
+
}),
|
|
2131
|
+
}).sign(this.sign);
|
|
2132
|
+
if (this.stopping || !this.started) {
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2067
2135
|
await this.publishMessageMaybe(
|
|
2068
2136
|
this.publicKey,
|
|
2069
|
-
|
|
2070
|
-
leaving: [peerKeyHash],
|
|
2071
|
-
header: new MessageHeader({
|
|
2072
|
-
session: this.session,
|
|
2073
|
-
mode: new SilentDelivery({ to: dependent, redundancy: 2 }),
|
|
2074
|
-
}),
|
|
2075
|
-
}).sign(this.sign),
|
|
2137
|
+
goodbye,
|
|
2076
2138
|
);
|
|
2077
2139
|
}
|
|
2078
2140
|
|
|
@@ -2959,6 +3021,7 @@ export abstract class DirectStream<
|
|
|
2959
3021
|
PriorityOptions &
|
|
2960
3022
|
ResponsePriorityOptions &
|
|
2961
3023
|
ExpiresAtOptions &
|
|
3024
|
+
ExpiresInOptions &
|
|
2962
3025
|
IdOptions & { skipRecipientValidation?: boolean } & WithExtraSigners,
|
|
2963
3026
|
) {
|
|
2964
3027
|
// dispatch the event if we are interested
|
|
@@ -3002,17 +3065,34 @@ export abstract class DirectStream<
|
|
|
3002
3065
|
}
|
|
3003
3066
|
|
|
3004
3067
|
setDeliveryOriginHop(mode, this.publicKeyHash);
|
|
3068
|
+
const expiresInMs = options.expiresInMs;
|
|
3069
|
+
if (expiresInMs != null) {
|
|
3070
|
+
if (options.expiresAt != null) {
|
|
3071
|
+
throw new InvalidMessageError(
|
|
3072
|
+
"expiresAt and expiresInMs cannot both be specified",
|
|
3073
|
+
);
|
|
3074
|
+
}
|
|
3075
|
+
if (!Number.isSafeInteger(expiresInMs) || expiresInMs <= 0) {
|
|
3076
|
+
throw new InvalidMessageError(
|
|
3077
|
+
"expiresInMs must be a positive safe integer",
|
|
3078
|
+
);
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3005
3081
|
|
|
3082
|
+
const header = new MessageHeader({
|
|
3083
|
+
id: options.id,
|
|
3084
|
+
mode,
|
|
3085
|
+
session: this.session,
|
|
3086
|
+
priority: options.priority,
|
|
3087
|
+
responsePriority: options.responsePriority,
|
|
3088
|
+
expires: options.expiresAt,
|
|
3089
|
+
});
|
|
3090
|
+
if (expiresInMs != null) {
|
|
3091
|
+
header.expires = header.timestamp + BigInt(expiresInMs);
|
|
3092
|
+
}
|
|
3006
3093
|
const message = new DataMessage({
|
|
3007
3094
|
data,
|
|
3008
|
-
header
|
|
3009
|
-
id: options.id,
|
|
3010
|
-
mode,
|
|
3011
|
-
session: this.session,
|
|
3012
|
-
priority: options.priority,
|
|
3013
|
-
responsePriority: options.responsePriority,
|
|
3014
|
-
expires: options.expiresAt,
|
|
3015
|
-
}),
|
|
3095
|
+
header,
|
|
3016
3096
|
});
|
|
3017
3097
|
|
|
3018
3098
|
// TODO allow messages to also be sent unsigned (signaturePolicy property)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-transfer.d.ts","sourceRoot":"","sources":["../../benchmark/chunk-transfer.ts"],"names":[],"mappings":""}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { tcp } from "@libp2p/tcp";
|
|
2
|
-
import { TestSession } from "@peerbit/libp2p-test-utils";
|
|
3
|
-
import { AcknowledgeDelivery } from "@peerbit/stream-interface";
|
|
4
|
-
import { waitForResolved } from "@peerbit/time";
|
|
5
|
-
import { DirectStream, waitForNeighbour, } from "../src/index.js";
|
|
6
|
-
const modes = ["silent", "ack"];
|
|
7
|
-
const envInt = (name, fallback) => {
|
|
8
|
-
const value = process.env[name];
|
|
9
|
-
if (value == null) {
|
|
10
|
-
return fallback;
|
|
11
|
-
}
|
|
12
|
-
const parsed = Number.parseInt(value, 10);
|
|
13
|
-
return Number.isFinite(parsed) ? parsed : fallback;
|
|
14
|
-
};
|
|
15
|
-
const chunkBytes = Math.max(1, envInt("CHUNK_TRANSFER_CHUNK_BYTES", 262144));
|
|
16
|
-
const chunkCount = Math.max(1, envInt("CHUNK_TRANSFER_CHUNKS", 24));
|
|
17
|
-
const warmupIterations = Math.max(0, envInt("CHUNK_TRANSFER_WARMUP", 1));
|
|
18
|
-
const iterations = Math.max(1, envInt("CHUNK_TRANSFER_ITERATIONS", 3));
|
|
19
|
-
const timeoutMs = Math.max(1_000, envInt("CHUNK_TRANSFER_TIMEOUT_MS", 30_000));
|
|
20
|
-
class TestStreamImpl extends DirectStream {
|
|
21
|
-
constructor(components) {
|
|
22
|
-
super(components, ["bench/0.0.0"], {
|
|
23
|
-
canRelayMessage: true,
|
|
24
|
-
connectionManager: false,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const round = (value, digits = 3) => Number.isFinite(value) ? Number(value.toFixed(digits)) : value;
|
|
29
|
-
const average = (values) => values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
30
|
-
const summarizeTask = (name, values) => {
|
|
31
|
-
const meanMs = average(values);
|
|
32
|
-
return {
|
|
33
|
-
name,
|
|
34
|
-
hz: round(1000 / meanMs, 6),
|
|
35
|
-
mean_ms: round(meanMs, 6),
|
|
36
|
-
rme: null,
|
|
37
|
-
samples: values.length,
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
const makePayload = (size, sequence) => {
|
|
41
|
-
const payload = new Uint8Array(size);
|
|
42
|
-
payload.fill(sequence % 251);
|
|
43
|
-
if (size >= 8) {
|
|
44
|
-
const view = Buffer.from(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
45
|
-
view.writeUInt32BE(sequence >>> 0, 0);
|
|
46
|
-
view.writeUInt32BE((sequence ^ 0x9e3779b9) >>> 0, 4);
|
|
47
|
-
}
|
|
48
|
-
return payload;
|
|
49
|
-
};
|
|
50
|
-
const readSequence = (data) => {
|
|
51
|
-
if (data.byteLength < 8) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
const view = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
55
|
-
return view.readUInt32BE(0);
|
|
56
|
-
};
|
|
57
|
-
const waitForPayloadBatch = (receiver, startSequence, count, timeout) => new Promise((resolve, reject) => {
|
|
58
|
-
const pending = new Set();
|
|
59
|
-
for (let i = 0; i < count; i++) {
|
|
60
|
-
pending.add(startSequence + i);
|
|
61
|
-
}
|
|
62
|
-
const timer = setTimeout(() => {
|
|
63
|
-
cleanup();
|
|
64
|
-
reject(new Error(`Timed out waiting for payload batch start=${startSequence} count=${count} pending=${pending.size}`));
|
|
65
|
-
}, timeout);
|
|
66
|
-
const onData = (event) => {
|
|
67
|
-
const data = event.detail.data;
|
|
68
|
-
const sequence = readSequence(data);
|
|
69
|
-
if (sequence == null || !pending.has(sequence)) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
pending.delete(sequence);
|
|
73
|
-
if (pending.size === 0) {
|
|
74
|
-
cleanup();
|
|
75
|
-
resolve();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const cleanup = () => {
|
|
79
|
-
clearTimeout(timer);
|
|
80
|
-
receiver.removeEventListener("data", onData);
|
|
81
|
-
};
|
|
82
|
-
receiver.addEventListener("data", onData);
|
|
83
|
-
});
|
|
84
|
-
const modeOptions = (mode, receiver) => mode === "ack"
|
|
85
|
-
? {
|
|
86
|
-
mode: new AcknowledgeDelivery({
|
|
87
|
-
redundancy: 1,
|
|
88
|
-
to: [receiver.publicKey],
|
|
89
|
-
}),
|
|
90
|
-
}
|
|
91
|
-
: {
|
|
92
|
-
to: [receiver.publicKey],
|
|
93
|
-
};
|
|
94
|
-
const runIteration = async (sender, receiver, mode, startSequence) => {
|
|
95
|
-
const payloads = Array.from({ length: chunkCount }, (_, index) => makePayload(chunkBytes, startSequence + index));
|
|
96
|
-
const startedAt = performance.now();
|
|
97
|
-
let receiverCompleteMs = 0;
|
|
98
|
-
const receivePromise = waitForPayloadBatch(receiver, startSequence, payloads.length, timeoutMs).then(() => {
|
|
99
|
-
receiverCompleteMs = performance.now() - startedAt;
|
|
100
|
-
});
|
|
101
|
-
for (const payload of payloads) {
|
|
102
|
-
await sender.publish(payload, modeOptions(mode, receiver));
|
|
103
|
-
}
|
|
104
|
-
const senderCompleteMs = performance.now() - startedAt;
|
|
105
|
-
await receivePromise;
|
|
106
|
-
return {
|
|
107
|
-
senderCompleteMs,
|
|
108
|
-
receiverCompleteMs,
|
|
109
|
-
senderAfterReceiverMs: Math.max(0, senderCompleteMs - receiverCompleteMs),
|
|
110
|
-
receiverAfterSenderMs: Math.max(0, receiverCompleteMs - senderCompleteMs),
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
const prepareSession = async () => {
|
|
114
|
-
const session = await TestSession.disconnected(4, {
|
|
115
|
-
transports: [tcp()],
|
|
116
|
-
services: { directstream: (c) => new TestStreamImpl(c) },
|
|
117
|
-
});
|
|
118
|
-
await session.connect([
|
|
119
|
-
[session.peers[0], session.peers[1]],
|
|
120
|
-
[session.peers[1], session.peers[2]],
|
|
121
|
-
[session.peers[2], session.peers[3]],
|
|
122
|
-
]);
|
|
123
|
-
const stream = (i) => session.peers[i].services.directstream;
|
|
124
|
-
await waitForNeighbour(stream(0), stream(1));
|
|
125
|
-
await waitForNeighbour(stream(1), stream(2));
|
|
126
|
-
await waitForNeighbour(stream(2), stream(3));
|
|
127
|
-
await stream(0).publish(new Uint8Array([1, 2, 3, 4]), {
|
|
128
|
-
mode: new AcknowledgeDelivery({
|
|
129
|
-
redundancy: 1,
|
|
130
|
-
to: [stream(3).publicKey],
|
|
131
|
-
}),
|
|
132
|
-
});
|
|
133
|
-
await waitForResolved(() => stream(0).routes.isReachable(stream(0).publicKeyHash, stream(3).publicKeyHash));
|
|
134
|
-
return {
|
|
135
|
-
session,
|
|
136
|
-
sender: stream(0),
|
|
137
|
-
receiver: stream(3),
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
const runMode = async (mode) => {
|
|
141
|
-
let sequence = 1_000;
|
|
142
|
-
const { session, sender, receiver } = await prepareSession();
|
|
143
|
-
const samples = [];
|
|
144
|
-
try {
|
|
145
|
-
for (let i = 0; i < warmupIterations; i++) {
|
|
146
|
-
await runIteration(sender, receiver, mode, sequence);
|
|
147
|
-
sequence += chunkCount;
|
|
148
|
-
}
|
|
149
|
-
for (let i = 0; i < iterations; i++) {
|
|
150
|
-
samples.push(await runIteration(sender, receiver, mode, sequence));
|
|
151
|
-
sequence += chunkCount;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
finally {
|
|
155
|
-
await session.stop();
|
|
156
|
-
}
|
|
157
|
-
return samples;
|
|
158
|
-
};
|
|
159
|
-
const results = await Promise.all(modes.map(async (mode) => ({
|
|
160
|
-
mode,
|
|
161
|
-
samples: await runMode(mode),
|
|
162
|
-
})));
|
|
163
|
-
const totalBytes = chunkBytes * chunkCount;
|
|
164
|
-
const totalMb = totalBytes / (1024 * 1024);
|
|
165
|
-
const tasks = [];
|
|
166
|
-
for (const result of results) {
|
|
167
|
-
tasks.push(summarizeTask(`${result.mode}: sender-complete`, result.samples.map((sample) => sample.senderCompleteMs)));
|
|
168
|
-
tasks.push(summarizeTask(`${result.mode}: receiver-complete`, result.samples.map((sample) => sample.receiverCompleteMs)));
|
|
169
|
-
tasks.push(summarizeTask(`${result.mode}: sender-after-receiver`, result.samples.map((sample) => sample.senderAfterReceiverMs)));
|
|
170
|
-
tasks.push(summarizeTask(`${result.mode}: receiver-after-sender`, result.samples.map((sample) => sample.receiverAfterSenderMs)));
|
|
171
|
-
}
|
|
172
|
-
const output = {
|
|
173
|
-
name: "chunk-transfer",
|
|
174
|
-
tasks,
|
|
175
|
-
meta: {
|
|
176
|
-
chunkBytes,
|
|
177
|
-
chunkCount,
|
|
178
|
-
totalBytes,
|
|
179
|
-
totalMb: round(totalMb, 3),
|
|
180
|
-
hops: 3,
|
|
181
|
-
warmupIterations,
|
|
182
|
-
iterations,
|
|
183
|
-
timeoutMs,
|
|
184
|
-
results: results.map((result) => ({
|
|
185
|
-
mode: result.mode,
|
|
186
|
-
senderCompleteMsAvg: round(average(result.samples.map((sample) => sample.senderCompleteMs))),
|
|
187
|
-
receiverCompleteMsAvg: round(average(result.samples.map((sample) => sample.receiverCompleteMs))),
|
|
188
|
-
senderAfterReceiverMsAvg: round(average(result.samples.map((sample) => sample.senderAfterReceiverMs))),
|
|
189
|
-
receiverAfterSenderMsAvg: round(average(result.samples.map((sample) => sample.receiverAfterSenderMs))),
|
|
190
|
-
senderMbPerSecondAvg: round(average(result.samples.map((sample) => totalMb / (sample.senderCompleteMs / 1000)))),
|
|
191
|
-
receiverMbPerSecondAvg: round(average(result.samples.map((sample) => totalMb / (sample.receiverCompleteMs / 1000)))),
|
|
192
|
-
samples: result.samples.map((sample) => ({
|
|
193
|
-
senderCompleteMs: round(sample.senderCompleteMs),
|
|
194
|
-
receiverCompleteMs: round(sample.receiverCompleteMs),
|
|
195
|
-
senderAfterReceiverMs: round(sample.senderAfterReceiverMs),
|
|
196
|
-
receiverAfterSenderMs: round(sample.receiverAfterSenderMs),
|
|
197
|
-
})),
|
|
198
|
-
})),
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
if (process.env.BENCH_JSON === "1") {
|
|
202
|
-
await new Promise((resolve, reject) => {
|
|
203
|
-
process.stdout.write(JSON.stringify(output, null, 2), (error) => {
|
|
204
|
-
if (error) {
|
|
205
|
-
reject(error);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
resolve();
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
console.table(tasks.map((task) => ({
|
|
214
|
-
task: task.name,
|
|
215
|
-
mean_ms: task.mean_ms,
|
|
216
|
-
ops_s: round(task.hz, 3),
|
|
217
|
-
samples: task.samples,
|
|
218
|
-
})));
|
|
219
|
-
}
|
|
220
|
-
process.exit(0);
|
|
221
|
-
//# sourceMappingURL=chunk-transfer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-transfer.js","sourceRoot":"","sources":["../../benchmark/chunk-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACN,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AC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;YAC/D,IAAI,KAAK,EAAE,CAAC;gBACX,MAAM,CAAC,KAAK,CAAC,CAAC;gBACd,OAAO;YACR,CAAC;YACD,OAAO,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;KAAM,CAAC;IACP,OAAO,CAAC,KAAK,CACZ,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACxB,OAAO,EAAE,IAAI,CAAC,OAAO;KACrB,CAAC,CAAC,CACH,CAAC;AACH,CAAC;AAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory "real DirectStream" simulator.
|
|
3
|
-
*
|
|
4
|
-
* Goal: run most of @peerbit/stream's real logic (routing, ACK learning, dialer,
|
|
5
|
-
* pruning) but swap the underlying libp2p transport for a lightweight, in-memory
|
|
6
|
-
* shim so we can explore 100s–1000s of nodes.
|
|
7
|
-
*
|
|
8
|
-
* Run:
|
|
9
|
-
* node --loader ts-node/esm ./packages/transport/stream/benchmark/directstream-sim.ts --nodes 200 --degree 4 --messages 20 --targets 5 --redundancy 2 --seed 1
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=directstream-sim.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directstream-sim.d.ts","sourceRoot":"","sources":["../../benchmark/directstream-sim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|