Skip to content

Feature Request: Support for Tracking Connection Time, Send Time, and Receive Time #2321

Open
@TheWalkingDead2

Description

@TheWalkingDead2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    s: featureThis issue indicates a feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions