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

Add LatencyUnit::Seconds #179

Merged
merged 1 commit into from
Nov 20, 2021
Merged

Add LatencyUnit::Seconds #179

merged 1 commit into from
Nov 20, 2021

Conversation

davidpdrsn
Copy link
Member

For formatting latencies as seconds when using TraceLayer:

.layer(TraceLayer::new_for_http().latency_unit(LatencyUnit::Seconds))

which gives this output:

Nov 19 16:45:53.003 DEBUG request{method=GET uri=/ version=HTTP/1.1}: tower_http::trace::on_response: finished processing request latency=0.000626625 s status=405

@davidpdrsn davidpdrsn merged commit 122db58 into master Nov 20, 2021
@davidpdrsn davidpdrsn deleted the latency-unit-seconds branch November 20, 2021 15:29
@davidpdrsn davidpdrsn mentioned this pull request Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants