Open MichaelMure opened 6 years ago
@MichaelMure ipfs stats bw
has a option --poll
that supports uninterrupted output. Therefore, I think it's not easy to achieve this feature by using Encoders
instead of PostRun
.
This looks fixable, it's just a bit tricky. The encoder will be called once per item.
How important is this. Maybe this is something we should wait on until we fix the need for using PostRun in most cases otherwise we run into the same problems we had with ipfs ls --stream
in particular it appears a header is outputted is some cases.
IMO, low priority. Most clients will just use HTTP directly.
Confirmed this is still a problem in 0.11.
Extracting specific value via ipfs stats bw --enc=json | jq <selector>
would be easier and more future-proof than parsing text with sed/awk. If it makes fix easier, we don't need to support JSON output in --poll
mode, fixing the default output would be more than enough.
Version information:
go-ipfs 0.4.17 and git master
Type:
Bug
Description:
All commands should support the
--enc
options. It doesn't work foripfs stats bw
I suppose because the result of the command is formatted in aPostRun
instead of anEncoders
.