[tor-commits] [gettor/develop] Adapted requests table to new stats
ilv at torproject.org
ilv at torproject.org
Fri Dec 4 18:19:12 UTC 2015
commit f6ed22811e74b615c048c8d8cd75c0eb01b9cd55
Author: ilv <ilv at users.noreply.github.com>
Date: Fri Dec 4 15:21:37 2015 -0300
Adapted requests table to new stats
---
scripts/create_db.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/scripts/create_db.py b/scripts/create_db.py
index ec4ba32..d6e0b0f 100644
--- a/scripts/create_db.py
+++ b/scripts/create_db.py
@@ -38,15 +38,16 @@ def main():
with con:
cur = con.cursor()
# table for handling users (i.e. blacklist)
- cur.execute("CREATE TABLE users(id TEXT, service TEXT, times INT,"
- " blocked INT, last_request TEXT)")
- # table for stats
- # cur.execute("CREATE TABLE requests(service TEXT, type TEXT,"
- # " os TEXT, lc TEXT, pt INT, year INT, month INT,"
- # " day INT, status TEXT, logfile TEXT)")
+ cur.execute(
+ "CREATE TABLE users(id TEXT, service TEXT, times INT,"
+ "blocked INT, last_request TEXT)"
+ )
+
+ cur.execute(
+ "CREATE TABLE requests(date TEXT, request TEXT, os TEXT,"
+ " locale TEXT, channel TEXT, PRIMARY KEY (date, channel))"
+ )
- # for now we will use a counter
- cur.execute("CREATE TABLE requests(id INT, counter INT)")
print "Database %s created" % os.path.abspath(args.create)
elif args.delete:
os.remove(os.path.abspath(args.delete))
More information about the tor-commits
mailing list