Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

feat(breaking change): use stream on stats.bw #686

Merged
merged 5 commits into from
Feb 7, 2018
Merged

Conversation

hacdias
Copy link
Contributor

@hacdias hacdias commented Jan 30, 2018

stats.bw has an option called poll which allows the user to "tell" IPFS to send bandwidth stats each interval of time. We were collecting the response before calling the callback so that option would be useless.

This way it sends a stream to the callback so the user can listen to data event which contains the Object.

Interface IPFS core update: ipfs-inactive/interface-js-ipfs-core#211

@hacdias
Copy link
Contributor Author

hacdias commented Jan 31, 2018

Needed for ipfs/js-ipfs#1198 /cc @diasdavid 😄 The new tests for this to pass are here: ipfs-inactive/interface-js-ipfs-core#211

@victorb
Copy link
Contributor

victorb commented Jan 31, 2018


Moved comment to the interface-ipfs-core PR

@hacdias
Copy link
Contributor Author

hacdias commented Feb 6, 2018

Note to self: Pull Stream version not working. Still don't know why.

return p.end(err)
}

pull(toPull(stream), p)
Copy link
Contributor

@dignifiedquire dignifiedquire Feb 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be simply

pull(pull.map(transformChunk), p)

if I understand it correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :D

@hacdias
Copy link
Contributor Author

hacdias commented Feb 7, 2018

This is passing with the tests from ipfs-inactive/interface-js-ipfs-core#211 😄

I think it's ready /cc @diasdavid

@daviddias
Copy link
Contributor

There you go :)

image

@hacdias
Copy link
Contributor Author

hacdias commented Feb 7, 2018

Thanks @diasdavid! Once the tests pass I'll ping you.

@hacdias
Copy link
Contributor Author

hacdias commented Feb 7, 2018

@diasdavid the failing tests are unrelated to Stats (stats are passing). I think we can merge this and release a new version 😄 so I can continue ipfs/js-ipfs#1198

@daviddias daviddias merged commit 895760e into master Feb 7, 2018
@daviddias daviddias deleted the stream-statsbw branch February 7, 2018 10:04
@ghost ghost removed the in progress label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants