Comments (4)
Some early findings: onUploadProgress works only in the browser, and progress-stream gives inaccurate results since axios reads from it faster than it actually sends over the network.
from swarm-cli.
Progress-Stream Test Results
Tested with a 160MB binary.
Axios consumed the stream within 722 ms (and in 7 parts).
Actual upload took 134,429 ms.
Looks like there is no easy way around this with Axios.
As an alternative enhancement I suggest using a simple spinner, and displaying the file size beforehand. Maybe also a broad estimation, eg. <10MB: a few seconds, <100MB a few minutes.
Monkey patching Axios could still be an option, but that sounds like going down a rabbit hole.
Details:
Progress event after 106 ms
{
percentage: 8.6328125,
transferred: 14483456,
length: 167772160,
remaining: 153288704,
eta: 11,
runtime: 0,
delta: 14483456,
speed: 14483456
}
Progress event after 239 ms
{
percentage: 13.789062499999998,
transferred: 23134208,
length: 167772160,
remaining: 144637952,
eta: 6,
runtime: 0,
delta: 8650752,
speed: 23134208
}
Progress event after 339 ms
{
percentage: 27.578124999999996,
transferred: 46268416,
length: 167772160,
remaining: 121503744,
eta: 3,
runtime: 0,
delta: 23134208,
speed: 46268416
}
Progress event after 439 ms
{
percentage: 49.453125,
transferred: 82968576,
length: 167772160,
remaining: 84803584,
eta: 1,
runtime: 0,
delta: 36700160,
speed: 82968576
}
Progress event after 539 ms
{
percentage: 67.5390625,
transferred: 113311744,
length: 167772160,
remaining: 54460416,
eta: 0,
runtime: 0,
delta: 30343168,
speed: 113311744
}
Progress event after 639 ms
{
percentage: 86.328125,
transferred: 144834560,
length: 167772160,
remaining: 22937600,
eta: 0,
runtime: 0,
delta: 31522816,
speed: 144834560
}
Progress event after 722 ms
{
percentage: 100,
transferred: 167772160,
length: 167772160,
remaining: 0,
eta: 0,
runtime: 0,
delta: 22937600,
speed: 134217728
}
Uploaded in 134429 ms
from swarm-cli.
Interesting. I seem to remember similar issues. My gut feeling is telling me we are doing something wrong (either on the JS or on the GO side), surely if Axios could not handle the upload progress correctly somebody would notice and fix it.
Out of curiosity did you try some other library like ky
to see if the upload progress works there?
from swarm-cli.
Cannot be implemented with axios. We added a spinner for intermediate resolution.
from swarm-cli.
Related Issues (20)
- `Invalid time value` on feed upload
- Revamp testing console messages (get rid of exact indices)
- balance is NaN HOT 2
- feat: more estimates during stamp purchase
- Trying to upload a file and getting false == true error HOT 2
- Feature request: calculate Swarm reference hash of content HOT 2
- remove greater than 100mb?
- Feature - Dry run Upload with CLI HOT 1
- Allow toping up stamps generated on another node HOT 1
- if in ultralight node, swarm-cli reports incorrect error
- estimate TTL for stamp based on current price
- bzz.link link no longer works
- Unclear Error "Invalid time value"
- feed print incorrect Number of updates
- feat: "dry run" determine what the hash of content that will be uploaded will be HOT 1
- feat: modify v3 password
- feat: unlock v3 wallet
- feat: lock private key
- Readme minimum bee version?
- When purchasing stamps, include effective volume as well HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swarm-cli.