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

duration as float? #4

Closed
reedwade opened this issue Feb 15, 2018 · 4 comments
Closed

duration as float? #4

reedwade opened this issue Feb 15, 2018 · 4 comments

Comments

@reedwade
Copy link
Contributor

Hi, looking at the W3C doc I'm hoping that duration can be a float?

I've got a mod for that at-- https://github.com/reedwade/go-server-timing/tree/float-duration

which causes the example to emit a header that looks like:

Server-Timing: service-4;dur=66.236352,service-2;dur=31.155601,service-1;dur=67.140114,service-3;dur=41.247412,service-0;dur=70.299034

This seems a lot more useful for a lot of server side things that happen quite fast (ideally).

@kasperlewau
Copy link

@reedwade

I cherrypicked your changes and they're beautiful!

Now I get to see microseconds in the Chrome devtools as opposed to a fixed 0 value for anything less than 1ms.

image

@mitchellh
Copy link
Owner

mitchellh commented Feb 15, 2018

This makes a ton of sense, please make your PR. :) And thank you!

It might make sense to limit to the # of decimal places to something like 2 or 3 though (chrome for example only shows 2).

@reedwade
Copy link
Contributor Author

I'm inclined to keep the full precision as I'm also logging the header line on the server side for later review.

@mitchellh
Copy link
Owner

Fixed via #7

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

No branches or pull requests

3 participants