-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
42 lines (28 loc) · 1.4 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
=== Installation ===
The installation assumes that the mlab database is set up corretly. This is described in the chokepoint wiki page.
Then the remaining steps are as follows:
Install django as described in https://www.djangoproject.com/download/
Open ./cpp_backend_cpp2/settings.py and change the database login and password
Also change the database in ./Makefile and then run make to create the django specific databases
A test server can the be run by:
python manage.py runserver
=== API interface ===
== Daily/Weekly/Monthly/Yearly averaged data ==
URL:
api/glasnost/XXX
XXX must be replaced by either: daily, weekly, monthly, yearly
Parameters:
start_date: only return measurements performed after start_date. The format must be YYYY-MM-DD HH:MM.
end_date: only return measurements performed before end_date. The format must be YYYY-MM-DD HH:MM.
country_code: return measurements with the specified country_code only.
destination: return measurements with the specified destination only.
Example:
api/glasnost/yearly/?start_date=2011-12-12%2012:12&end_date=2012-12-12%2012:12
== Mean calculations ==
URL:
api/glasnost/daily/mean/
Parameters:
data_points: the number of past data points that will be used to compute the mean
days_to_subtract: the distance of two data points in days
date: the most recent date of the mean computation
api/glasnost/daily/mean/?date=2011-01-30&data_points=6&days_to_subtract=7