зеркало из https://github.com/mozilla/rappor.git
Addressing Andy's comments.
This commit is contained in:
Родитель
c593789faf
Коммит
b303d8be55
16
regtest.sh
16
regtest.sh
|
@ -171,10 +171,6 @@ _run-one-instance() {
|
|||
|
||||
banner "Using gen_counts.R"
|
||||
|
||||
echo tests/gen_counts.R $distr $num_clients $values_per_client $params_file \
|
||||
$true_map_file "$instance_dir/case"
|
||||
|
||||
|
||||
tests/gen_counts.R $distr $num_clients $values_per_client $params_file \
|
||||
$true_map_file "$instance_dir/case"
|
||||
else
|
||||
|
@ -232,11 +228,6 @@ _run-one-instance-logged() {
|
|||
|| log "Test case $test_case_id (instance $test_case_run) failed"
|
||||
}
|
||||
|
||||
show-help() {
|
||||
tests/gen_sim_input.py || true
|
||||
tests/rappor_sim.py -h || true
|
||||
}
|
||||
|
||||
make-summary() {
|
||||
local dir=$1
|
||||
local filename=${2:-results.html}
|
||||
|
@ -273,8 +264,7 @@ _setup-test-instances() {
|
|||
local fast_counts=$2
|
||||
|
||||
while read line; do
|
||||
for ((i=1; i<=$instances; i++))
|
||||
do
|
||||
for i in $(seq 1 $instances); do
|
||||
read case_name _ <<< $line # extract the first token
|
||||
echo $case_name $i $fast_counts
|
||||
done
|
||||
|
@ -304,8 +294,8 @@ _run-tests() {
|
|||
func=_run-one-instance # output to the console
|
||||
else
|
||||
func=_run-one-instance-logged
|
||||
processors=$(grep -c ^processor /proc/cpuinfo)
|
||||
if test $processors -gt 1; then # leave one for the OS
|
||||
processors=$(grep -c ^processor /proc/cpuinfo || echo 4) # POSIX-specific
|
||||
if test $processors -gt 1; then # leave one CPU for the OS
|
||||
processors=$(expr $processors - 1)
|
||||
fi
|
||||
log "Running $processors parallel processes"
|
||||
|
|
|
@ -84,7 +84,7 @@ LoadInputs <- function(prefix_case, prefix_instance, ctx) {
|
|||
|
||||
# The line is searched for, and elapsed time is extracted, by make_summary.py.
|
||||
# Should the formating or wording change, make_summary must be updated too.
|
||||
Log(c("Inference took", timing["elapsed"], "seconds"))
|
||||
Log("Inference took %.3f seconds", timing[["elapsed"]])
|
||||
|
||||
Log("Analysis Results:")
|
||||
str(rappor)
|
||||
|
|
|
@ -134,9 +134,9 @@ ComputePdf <- function(distr, range) {
|
|||
} else if (distr == 'zipf1') {
|
||||
# Since the distrubition defined over a finite set, we allow the parameter
|
||||
# of the Zipf distribution to be 1.
|
||||
pdf <- sapply(1:range, function(x) 1/x)
|
||||
pdf <- sapply(1:range, function(x) 1 / x)
|
||||
} else if (distr == 'zipf1.5') {
|
||||
pdf <- sapply(1:range, function(x) 1/x^1.5)
|
||||
pdf <- sapply(1:range, function(x) 1 / x^1.5)
|
||||
}
|
||||
else {
|
||||
stop(sprintf("Invalid distribution '%s'", distr))
|
||||
|
|
|
@ -52,11 +52,11 @@ main <- function(argv) {
|
|||
|
||||
stopifnot(length(values) == num_clients)
|
||||
|
||||
# Shuffle values randomly (make take a few sec for > 10^8 inputs)
|
||||
# Shuffle values randomly (may take a few sec for > 10^8 inputs)
|
||||
values <- sample(values)
|
||||
|
||||
# Obtain reports by prefixing values with "v"s. Even slower than shuffling.
|
||||
reports <- paste("v", format(values, trim = TRUE), sep = "")
|
||||
reports <- sprintf("v%d", values)
|
||||
|
||||
reports <- cbind(1:num_clients, reports) # paste together "1 v342"
|
||||
reports <- reports[rep(1:nrow(reports), each = reports_per_client), ]
|
||||
|
|
|
@ -243,10 +243,10 @@ def FormatCell1(test_case, test_instance, metrics_file, log_file, plot_file,
|
|||
if link_to_plots:
|
||||
link = '#{}_{}'.format(test_case, test_instance) # anchor
|
||||
else:
|
||||
link = relpath_report + '/' + 'dist.png'
|
||||
link = os.path.join(relpath_report, 'dist.png')
|
||||
else: # no results likely due to an error, puts a link to the log file
|
||||
external_file = log_file
|
||||
link = relpath_report + '/' + 'log.txt'
|
||||
link = os.path.join(relpath_report, 'log.txt')
|
||||
|
||||
if os.path.isfile(external_file):
|
||||
return '<td><a href="{}">{}</a></td>'.format(link, test_case)
|
||||
|
|
|
@ -36,7 +36,7 @@ DISTRIBUTIONS = (
|
|||
DISTRIBUTION_PARAMS = (
|
||||
# name, num unique values, num clients, values per client
|
||||
('tiny', 100, 1000, 1), # test for insufficient data
|
||||
('small', 100, 100000, 1),
|
||||
('small', 100, 1000000, 1),
|
||||
('medium', 1000, 10000000, 1),
|
||||
('large', 10000, 100000000, 1),
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче