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
os_mon: allow check intervals smaller than 1 minute #6385
os_mon: allow check intervals smaller than 1 minute #6385
Conversation
CT Test Results 2 files 15 suites 3m 55s ⏱️ Results for commit 3fa8a04. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
lib/os_mon/src/disksup.erl
Outdated
param_type(disk_space_check_interval, Val) when is_integer(Val), | ||
Val>=1 -> true; | ||
param_type(disk_space_check_interval, Val) when is_number(Val), | ||
0<Val -> true; |
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.
not sure if this is a concern, but this seems to allow an effective check interval of zero if Val
is smaller than 1 / 60_000
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.
thanks
4bf43e5
to
1743a31
Compare
@jdamanalo thanks for getting this, it was my next task after #6384 Rather than use a float I was planning to allow a user to specify milliseconds via a tagged tuple:
...but that's different than what @rickard-green suggested here. "fractional minutes" is just a weird unit to use IMHO. |
@lukebakken indeed, it is uncommon to have fractional minutes. I was just conscious of not adding a new "api". Nevertheless, I would be happy to implement the millisecond way. What do you think @rickard-green? |
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.
Regarding usage of a {millisecond, Time}
tuple. If so, I would rather want it to be {TimeUnit, Time}
, where TimeUnit
is of the type erlang:time_unit()
, than just the millisecond
time unit. Also easy to implement using erlang:convert_time_unit/3
for conversion.
lib/os_mon/doc/src/disksup.xml
Outdated
@@ -63,7 +63,7 @@ | |||
<p>The following configuration parameters can be used to change | |||
the default values for time interval and threshold:</p> | |||
<taglist> | |||
<tag><c>disk_space_check_interval = int()>0</c></tag> | |||
<tag><c>disk_space_check_interval = float()>=1/60000</c></tag> |
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.
<tag><c>disk_space_check_interval = float()>=1/60000</c></tag> | |
<tag><c>disk_space_check_interval = number()>=1/60000</c></tag> |
lib/os_mon/doc/src/disksup.xml
Outdated
@@ -126,7 +126,7 @@ | |||
<name since="">set_check_interval(Minutes) -> ok</name> | |||
<fsummary>Set time interval, in minutes, for the periodic disk space check</fsummary> | |||
<type> | |||
<v>Minutes = int()>=1</v> | |||
<v>Minutes = float()>=1/60000</v> |
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.
<v>Minutes = float()>=1/60000</v> | |
<v>Minutes = number()>=1/60000</v> |
Thanks for the feedback @rickard-green |
1743a31
to
0f45e4b
Compare
0f45e4b
to
09539cf
Compare
3304d34
to
ec122a7
Compare
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 squashed and force pushed the doc fix.
We'll have a technical board meeting on Thursday where this PR will be brought up. I expect it to be accepted assuming we have no issues in testing.
- expand type of `disk_space_check_interval` to `Minute | {TimeUnit, Time}`
ec122a7
to
3fa8a04
Compare
disk_space_check_interval
tonumber()
Fix #6283