diff --git a/.gitmodules b/.gitmodules index d5a8f6f..5020e37 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "uwhoisd"] path = uwhoisd url = https://github.com/Rafiot/uwhoisd.git +[submodule "faup"] + path = faup + url = https://github.com/stricaud/faup.git +[submodule "redis"] + path = redis + url = https://github.com/antirez/redis.git diff --git a/.travis.yml b/.travis.yml index 0d40c1f..bd40c43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: - "2.7" sudo: required +dist: trusty addons: apt: @@ -11,7 +12,7 @@ addons: - parallel install: - - git clone git://github.com/stricaud/faup.git + # Faup - pushd faup/build - cmake .. && make - sudo make install @@ -20,21 +21,33 @@ install: - pushd faup/src/lib/bindings/python - python setup.py install - popd - - pip install -r requirements.txt + # redis + - pushd redis + - make + - popd + # Run uwhoisd - pushd uwhoisd - python setup.py install + - ../redis/src/redis-server extra/redis.conf --daemonize yes + - sleep 10 + - uwhoisd extra/uwhoisd.ini & - popd + # Other Python deps + - pip install -r requirements.txt - pip install coveralls - pip install codecov - - cp config.ini.sample config.ini before_script: - - redis-server /etc/redis/redis.conf --port 6334 --daemonize yes + - cp config.ini.sample config.ini + - redis/src/redis-server --port 6334 --daemonize yes + - sleep 10 script: - ./worker.py & - ./runapp.py & - - sleep 30 + - sleep 5 + - curl http://0.0.0.0:5100/ + - sleep 20 after_success: - coveralls diff --git a/faup b/faup new file mode 160000 index 0000000..9a1440d --- /dev/null +++ b/faup @@ -0,0 +1 @@ +Subproject commit 9a1440d23290670b4c67d4b15cee19f534adadc7 diff --git a/redis b/redis new file mode 160000 index 0000000..83b862a --- /dev/null +++ b/redis @@ -0,0 +1 @@ +Subproject commit 83b862a30ee90ee5f85eefcc63ff5241b501f073 diff --git a/stats_generator.py b/stats_generator.py new file mode 100644 index 0000000..e72b051 --- /dev/null +++ b/stats_generator.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from datetime import date, timedelta +import redis + + +def perdelta(start, end, delta): + curr = start + while curr < end: + yield curr + curr += delta + +r = redis.Redis('localhost', 6334, db=1) + +for result in perdelta(date(2015, 03, 01), date(2015, 12, 12), timedelta(days=1)): + val = r.zcard('{}_submissions'.format(result)) + print('{},{}'.format(result, val))