Skip to content
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: Support for Tracking Connection Time, Send Time, and Receive Time #2321

Open
TheWalkingDead2 opened this issue Nov 6, 2024 · 3 comments
Labels
s: feature This issue indicates a feature request

Comments

@TheWalkingDead2
Copy link

TheWalkingDead2 commented Nov 6, 2024

Request Statement

Hello, Dio team!

Firstly, thanks for the incredible work on Dio—it’s been a very useful tool in our Flutter applications!

Feature Request
We would like to request the ability to track detailed timing metrics for network requests. Specifically, it would be very helpful to have built-in support for recording:

  1. Connection Time: The time taken to establish a connection to the server.
  2. Send Time: The time taken to send the request data to the server.
  3. Receive Time: The time taken to receive the response data from the server.

Use Case
Having access to these metrics would provide valuable insights into our app's network performance on mobile devices, allowing us to:

  1. Analyze endpoint performance across various mobile network conditions.
  2. Identify potential bottlenecks in the network request process.
  3. Collaborate with our backend team to pinpoint API endpoints that could benefit from optimization.

Solution Brainstorm

Potential Solution
An option could be to expose these metrics via Dio's interceptors or add them as properties within the response metadata. This would allow developers to easily access the timings after a request completes.

Example of Desired Usage

final dio = Dio();
final response = await dio.get('https://example.com');

// Accessing timing metrics
print('Connection Time: ${response.connectionTime} ms');
print('Send Time: ${response.sendTime} ms');
print('Receive Time: ${response.receiveTime} ms');

Thanks for considering this request! Having these metrics would significantly improve our ability to monitor and optimize network performance on mobile devices.

@TheWalkingDead2 TheWalkingDead2 added the s: feature This issue indicates a feature request label Nov 6, 2024
@AlexV525
Copy link
Member

@kuhnroyal We used to have similar discussion, right? Can't remember where it is...

@TheWalkingDead1024
Copy link

@kuhnroyal We used to have similar discussion, right? Can't remember where it is...

hi,any update?

@BekNaji
Copy link

BekNaji commented Dec 16, 2024

alternative package: dio_http2_adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: feature This issue indicates a feature request
Projects
None yet
Development

No branches or pull requests

4 participants