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

os_mon: allow check intervals smaller than 1 minute #6385

Merged

Conversation

jdamanalo
Copy link
Contributor

  • Expanded type of disk_space_check_interval to number()
1> disksup:set_check_interval(0.5).

Fix #6283

@CLAassistant
Copy link

CLAassistant commented Oct 22, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2022

CT Test Results

    2 files    15 suites   3m 55s ⏱️
111 tests 108 ✔️ 3 💤 0
130 runs  127 ✔️ 3 💤 0

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

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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@jdamanalo jdamanalo force-pushed the os_mon/disksup_interval_fraction branch from 4bf43e5 to 1743a31 Compare October 22, 2022 18:09
@lukebakken
Copy link
Contributor

lukebakken commented Oct 22, 2022

@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:

{millisecond, 500}

...but that's different than what @rickard-green suggested here.

"fractional minutes" is just a weird unit to use IMHO.

@jdamanalo
Copy link
Contributor Author

@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?

@rickard-green rickard-green added the team:VM Assigned to OTP team VM label Oct 24, 2022
@rickard-green rickard-green self-assigned this Oct 24, 2022
Copy link
Contributor

@rickard-green rickard-green left a 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.

@@ -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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<tag><c>disk_space_check_interval = float()>=1/60000</c></tag>
<tag><c>disk_space_check_interval = number()>=1/60000</c></tag>

@@ -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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<v>Minutes = float()>=1/60000</v>
<v>Minutes = number()>=1/60000</v>

@lukebakken
Copy link
Contributor

Thanks for the feedback @rickard-green

@rickard-green rickard-green added the testing currently being tested, tag is used by OTP internal CI label Nov 1, 2022
@jdamanalo jdamanalo force-pushed the os_mon/disksup_interval_fraction branch from 1743a31 to 0f45e4b Compare November 3, 2022 09:57
lib/os_mon/src/disksup.erl Outdated Show resolved Hide resolved
lib/os_mon/doc/src/disksup.xml Outdated Show resolved Hide resolved
lib/os_mon/doc/src/disksup.xml Outdated Show resolved Hide resolved
@jdamanalo jdamanalo force-pushed the os_mon/disksup_interval_fraction branch from 0f45e4b to 09539cf Compare November 8, 2022 12:17
@rickard-green rickard-green added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Nov 8, 2022
lib/os_mon/doc/src/disksup.xml Outdated Show resolved Hide resolved
@rickard-green rickard-green added the testing currently being tested, tag is used by OTP internal CI label Nov 8, 2022
@rickard-green rickard-green force-pushed the os_mon/disksup_interval_fraction branch from 3304d34 to ec122a7 Compare November 8, 2022 17:03
@rickard-green rickard-green added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Nov 8, 2022
Copy link
Contributor

@rickard-green rickard-green left a 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.

@rickard-green rickard-green added the testing currently being tested, tag is used by OTP internal CI label Nov 8, 2022
- expand type of `disk_space_check_interval` to `Minute | {TimeUnit, Time}`
@rickard-green rickard-green force-pushed the os_mon/disksup_interval_fraction branch from ec122a7 to 3fa8a04 Compare November 8, 2022 17:40
@rickard-green rickard-green added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Nov 8, 2022
@rickard-green rickard-green merged commit a8974b0 into erlang:maint Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants