Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

fix: remove tracked map as the stats overwrite each other #217

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
"@libp2p/interface-connection": "^3.0.1",
"@libp2p/interface-stream-muxer": "^2.0.0",
"@libp2p/logger": "^2.0.0",
"@libp2p/tracked-map": "^2.0.0",
"abortable-iterator": "^4.0.2",
"any-signal": "^3.0.0",
"err-code": "^3.0.1",
Expand Down
5 changes: 2 additions & 3 deletions src/mplex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { restrictSize } from './restrict-size.js'
import { MessageTypes, MessageTypeNames, Message } from './message-types.js'
import { createStream } from './stream.js'
import { toString as uint8ArrayToString } from 'uint8arrays'
import { trackedMap } from '@libp2p/tracked-map'
import { logger } from '@libp2p/logger'
import errCode from 'err-code'
import { RateLimiterMemory } from 'rate-limiter-flexible'
Expand Down Expand Up @@ -71,11 +70,11 @@ export class MplexStreamMuxer implements StreamMuxer {
/**
* Stream to ids map
*/
initiators: trackedMap<number, MplexStream>({ metrics: components.getMetrics(), component: 'mplex', metric: 'initiatorStreams' }),
initiators: new Map<number, MplexStream>(),
/**
* Stream to ids map
*/
receivers: trackedMap<number, MplexStream>({ metrics: components.getMetrics(), component: 'mplex', metric: 'receiverStreams' })
receivers: new Map<number, MplexStream>()
}
this._init = init

Expand Down