| .. | ||
| alarm-lib.sh | ||
| assoc.sh | ||
| combine_results_test.py | ||
| combine_results.py | ||
| combine_status_test.py | ||
| combine_status.py | ||
| cook.sh | ||
| csv_to_html_test.py | ||
| csv_to_html.py | ||
| csv-to-html-test.sh | ||
| dist.sh | ||
| metric_status.R | ||
| README.md | ||
| regtest.sh | ||
| task_spec_test.py | ||
| task_spec.py | ||
| tools-lib.sh | ||
| ui.sh | ||
| util.py | ||
pipeline
This directory contains tools and scripts for running a cron job that does RAPPOR analysis and generates an HTML dashboard.
It works like this:
-
task_spec.pygenerates a text file where each line corresponds to a process to be run (a "task"). The process isbin/decode-distorbin/decode-assoc. The line contains the task parameters. -
xargs -Pis used to run processes in parallel. Our analysis is generally single-threaded (i.e. because R is single-threaded), so this helps utilize the machine fully. Each task places its output in a different subdirectory. -
cook.shcallscombine_results.pyto combine analysis results into a time series. It also callscombine_status.pyto keep track of task data for "meta-analysis".metric_status.Rgenerates more summary CSV files. -
ui.shcallscsv_to_html.pyto generate an HTML fragments from the CSV files. -
The JavaScript in
ui/ui.jsis loaded from static HTML, and makes AJAX calls to retrieve the HTML fragments. The page is made interactive withui/table-lib.js.
dist.sh and assoc.sh contain functions which coordinate this process.
alarm-lib.sh is used to kill processes that have been running for too long.
Testing
pipeline/regtest.sh contains end-to-end demos of this process. Right now it
depends on testdata from elsewhere in the tree:
rappor$ ./demo.sh run # prepare dist testdata
rappor$ cd bin
bin$ ./test.sh write-assoc-testdata # prepare assoc testdata
bin$ cd ../pipeline
pipeline$ ./regtest.sh dist
pipeline$ ./regtest.sh assoc
pipeline$ python -m SimpleHTTPServer # start a static web server
http://localhost:8000/_tmp/