show die-status in the stats list

This commit is contained in:
2019-07-08 11:39:38 +03:00
parent 62a22639b1
commit da5c54017c
2 changed files with 7 additions and 4 deletions

View File

@@ -209,7 +209,7 @@ class DataBase:
def list(self):
self.db = self.conn.cursor()
self.db.execute("SELECT id,port,host,date,pid FROM ports ORDER BY id")
self.db.execute("SELECT id,port,host,date,pid,die FROM ports ORDER BY id")
rows = []
for row in self.db:
row = list(row)
@@ -271,7 +271,7 @@ if __name__ == "__main__":
if opts.list:
print(tabulate(
db.list(),
headers = ['Id','Port','Host','Age','PID','Alive']
headers = ['Id','Port','Host','Age','PID','Die','Alive']
))
if opts.query != None:
@@ -297,7 +297,7 @@ if __name__ == "__main__":
db.check_die()
db.update(opts.id)
for i in range(10):
time.sleep(1)#0 * random.random())
time.sleep(10 * random.random())
ewrite(
" " +
time.strftime("%c") +

View File

@@ -42,6 +42,9 @@ while true; do
# failed
#_ssh bin/ssh-kill $USER@$HOSTNAME $port || true
}
sleep 10
for i in {1..10}; do
sleep 1
printf " $i\r"
done
done
kill %1