Total download stats per app (since October)

This commit is contained in:
Ciaran Gultnieks 2012-01-22 11:00:45 +00:00
parent ecaa70905b
commit 3f02d0e126
3 changed files with 208 additions and 1 deletions

View file

@ -121,8 +121,17 @@ for logfile in glob.glob(os.path.join(logsdir,'access-*.log')):
if not apkname in unknownapks:
unknownapks.append(apkname)
f = open('stats/total_downloads_app.txt', 'w')
lst = []
alldownloads = 0
for app, count in apps.iteritems():
print app + " " + str(count)
lst.append(app + " " + str(count))
alldownloads += count
lst.append("ALL " + str(alldownloads))
f.write('# Total downloads by application, since October 2011\n')
for line in sorted(lst):
f.write(line + '\n')
f.close()
if len(unknownapks) > 0:
print '\nUnknown apks:'