Skip to content

[Feature] Expose HTTP Request Elapsed Time in ExecutionResult.extensions for RequestsHTTPTransport #559

@adamzev

Description

@adamzev

It would be useful for performance monitoring, logging and debugging if the HTTP request elapsed time (duration) was included in the ExecutionResult returned by RequestsHTTPTransport. The extensions field for implementation-specific data seems like the place to expose this data.

The underlying requests.Response object has .elapsed, but this is not currently exposed via any public API or returned result.

Proposed Solution

  • When constructing the ExecutionResult in RequestsHTTPTransport, add a key (e.g., "elapsed") to the extensions dictionary, with the value set to response.elapsed.total_seconds().
  • This information will then be accessible as result.extensions["elapsed"] for any consumer of the library, without breaking any existing API.

Alternatives Considered

  • Subclassing RequestsHTTPTransport and overriding execute. This is not practical, as internal APIs are not designed for easy override, and the requests.Response object is not exposed.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions