Add isahc metrics to response if available#56
Conversation
|
Don't these need to be manually enabled? |
|
We probably don't want them on all the time, so this should either have some kind of api or a configuration flag if this crate is going to be turning them on. Or are these available if you |
|
The metrics have to be manually enabled when building the client, so they are not always populated. An example how to create a surf client with isahc's metrics enabled: So yes, only via |
Those metrics then can be consumed via the response extensions.
```rust
let res: http_types::Response = some_req.await?;
if let Some(metrics) = &res.ext::<isahc::Metrics>() {
// use the metrics ...
}
```
|
Hi there, |
|
Note: a new release is kinda blocked on figuring out http-rs/surf#271 atm. |
Those metrics then can be consumed via the response extensions.
They contain very intersesting request timing data, useful for stats, tracing, benchmarks and similar use cases.