-
Notifications
You must be signed in to change notification settings - Fork 67
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 support for all Elixir time units #72
Conversation
This looks good. Could you add test cover for the new types, too? That will turn the build green. |
Sure, I'll do that. |
Hello, @thecodeboss! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information. |
lib/elixometer.ex
Outdated
The time units default to *microseconds*, but you can pass in a unit of | ||
`:millis` and the value will be converted. | ||
The time units default to *microseconds*, but you can also pass in any of | ||
the units in [`System.time_unit.t`](https://hexdocs.pm/elixir/System.html#t:time_unit/0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to write just System.time_unit.t
, and ex_doc will automatically linkify this for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to fiddle with the syntax a little, but I was able to get t:System.time_unit/0
to link correctly.
Thanks! |
To maintain consistency with the Elixir standard library, Elixometer should support all the same time units. These can be viewed at https://hexdocs.pm/elixir/System.html#t:time_unit/0.
I left in support for
:micros
and:millis
so that this is not a breaking change, but I also made:microsecond
the default.