that’s not currently possible indeed. If we would measure such a value it would still of some questionable value as processing a request can contain those steps:
- (maybe) look up the hostname on DNS
- (maybe) establish a TCP connection
- (maybe) establish a TLS connection
- serialize the request
- send data to the OS on the client
- send data over the network
- dynamically adjust transmission speeds between hosts
- receive data on the server
- deserialize request on the server
- actually process the request
- serialize response
- … (everything in the other direction)
From the view of the client, most of those steps are opaque, so measuring complete end-to-end latencies seems more useful.
If you are particularly concerned about connection creation overhead, you can use
akka.http.host-connection-pool.min-connections to let the pool pre-connect to the host. Afterwards, the connections should be “somewhat hot”. Even this won’t be perfect as a TCP connection doesn’t necessarily ramp up connection windows until enough actual data has moved back and forth (especially on high-latency, high-throughput connections).
That doesn’t mean that we might add some simple metrics like this to the pool at some point.