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

Fix logging of query durations, which were off by 10x for µs precision #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mloughran
Copy link

Has been broken since it was originally implemented in 3d73a5d.

Noticed while implementing a similar method in our own code. @Blacksmoke16 is something of this ilk (more readable short span printing) a candidate for stdlib do you think?

Has been broken since it was originally implemented in 3d73a5d.
@Blacksmoke16
Copy link
Contributor

Dunno, are free to make an issue/thread suggesting it and see what others think.

@robacarp
Copy link
Member

@mloughran @Blacksmoke16 I have the same code and bug in mosquito -- I'm sure I copied this stanza from Granite to Mosquito, or the reverse depending on the day.

@mloughran
Copy link
Author

@robacarp ha, well that does support my case. There's some similar code in Clear (and I'm sure all sorts of other places), but thankfully this wasn't a copy-paste 😄

Given that the common use case seems to be logging, maybe there is an argument for handling Time::Span in log metadata. This however then raises the question of how the JSON logger should serialise spans (see crystal-lang/crystal#11942). In any case this is all rather off-topic for this PR! I will consider some more and may open a crystal issue.

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.

3 participants