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

Replace sleep code #24

Closed
PhilipMay opened this issue Jun 15, 2022 · 1 comment
Closed

Replace sleep code #24

PhilipMay opened this issue Jun 15, 2022 · 1 comment

Comments

@PhilipMay
Copy link
Collaborator

PhilipMay commented Jun 15, 2022

IMO this code:

collect()
start_time = time.time()
while True:
elapsed_time = time.time() - start_time
if elapsed_time > 20.0:
start_time = time.time()
collect()
time.sleep(0.1)

can be replaced by just this:

    while True:
        collect()
        time.sleep(20)

What do you think?

ngosang added a commit to ngosang/prometheus-smartctl that referenced this issue Jul 27, 2022
@ngosang
Copy link
Collaborator

ngosang commented Jul 27, 2022

Closed by #29

@ngosang ngosang closed this as completed Jul 27, 2022
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

2 participants