From: František Dvořák Date: Thu, 5 Mar 2015 16:47:58 +0000 (+0100) Subject: Write also number of jobs processed. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=86da4588d5f5110c0784678411c2b2a8e72aca92;p=hadoop-jobstat.git Write also number of jobs processed. --- diff --git a/stat2pbs.py b/stat2pbs.py index 70b994c..2aa202a 100755 --- a/stat2pbs.py +++ b/stat2pbs.py @@ -149,15 +149,18 @@ if ts: st.execute('SELECT * FROM jobs WHERE changed > %s AND TIMESTAMPDIFF(SECOND,changed,NOW()) > 5 ORDER BY CHANGED', ts) else: st.execute('SELECT * FROM jobs WHERE TIMESTAMPDIFF(SECOND,changed,NOW()) > 5 ORDER BY changed') +counter=0 while 1: job = st.fetchone() if not job: break + counter += 1 ts = job['changed'] print gen_string(job) db.close() +print 'Processed: %d jobs' % counter if ts: f = open(statfile, 'w') f.write(str(ts) + '\n')