matusnovak / prometheus-smartctl

HDD S.M.A.R.T exporter for Prometheus written in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace sleep code

PhilipMay opened this issue · comments

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?

Closed by #29