-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: keep track of bandwidth usage #87
Comments
@szmarczak any chance you could have a look at this and decide if you'd consider discussing it? Thanks! |
Do you mean just HTTP/2 or both HTTP/2 and HTTP/1 requests? |
Thanks for getting back to me. I mainly use HTTP/2, so for me that would help a lot, but I guess it would be a useful feature in general, as if you're using a metered proxy connection, it's good to know how much you "spend". |
This is quite problematic, because the socket is unassigned when the session is closed. Node.js' idea is that you can't modify the socket, so probably that's why. const http2 = require('http2');
const session = http2.connect('https://example.com');
session.once('close', () => {
console.log(Boolean(session.socket)); // false
});
session.once('remoteSettings', () => {
// However this works
session.socket.once('close', function() {
console.log(this.bytesRead);
});
session.close();
}); |
I think you might be looking for https://nodejs.org/api/perf_hooks.html#http2-http2-details |
Ref: nodejs/node#22268 |
thanks @szmarczak |
Would be great to get the current total bandwidth usage of this component. So as I do requests through got for example, I could see how much proxy bandwidth I used up. Thanks!
The text was updated successfully, but these errors were encountered: