Skip to content

Instantly share code, notes, and snippets.

@vhxs
Last active November 7, 2022 23:15
Show Gist options
  • Save vhxs/0fd2fb340d6993b435f078c3dee26092 to your computer and use it in GitHub Desktop.
Save vhxs/0fd2fb340d6993b435f078c3dee26092 to your computer and use it in GitHub Desktop.
minimal pmtr test
import time
fout = open("test_1.txt", "w")
i = 0
while True:
fout.write(f"heartbeat {i}\n")
fout.flush()
i += 1
time.sleep(1)
import time
fout = open("test_3.txt", "w")
i = 0
while True:
fout.write(f"heartbeat {i}\n")
fout.flush()
i += 1
time.sleep(3)
import time
fout = open("test_5.txt", "w")
i = 0
while True:
fout.write(f"heartbeat {i}\n")
fout.flush()
i += 1
time.sleep(5)
job {
name heartbeat_1
dir /home/vsaraph
user vsaraph
cmd /usr/bin/python3 /home/vsaraph/pmtr_scripts/heartbeat_every_1s.py
out /home/vsaraph/pmtr_logs/heartbeat_every_1s.log
}
job {
name heartbeat_5
dir /home/vsaraph
user vsaraph
cmd /usr/bin/python3 /home/vsaraph/pmtr_scripts/heartbeat_every_5s.py
out /home/vsaraph/pmtr_logs/heartbeat_every_5s.log
}
job {
name heartbeat_3
dir /home/vsaraph
user vsaraph
cmd /usr/bin/python3 /home/vsaraph/pmtr_scripts/heartbeat_every_3s.py
out /home/vsaraph/pmtr_logs/heartbeat_every_3s.log
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment