Permalink
Browse files

Generating an HTML report for the vm-baseline benchmark.

Misc benchmark code cleanup.
  • Loading branch information...
Andy Chu
Andy Chu committed Dec 8, 2017
1 parent 0931858 commit 58213dd993ef1cdd18d2ee7be61369c37d140146
View
@@ -10,6 +10,7 @@ set -o pipefail
set -o errexit
source test/common.sh
source benchmarks/common.sh
readonly BASE_DIR=_tmp/oheap
@@ -36,7 +37,6 @@ encode-all() {
$0 encode-one
}
# Out of curiousity, compress oheap and originals.
compress-oheap() {
View
@@ -97,7 +97,7 @@ readonly NUM_COLUMNS=6 # 5 from provenance, 1 for file
# Figure out all tasks to run, and run them. When called from auto.sh, $2
# should be the ../benchmarks-data repo.
all() {
measure() {
local provenance=$1
local raw_dir=${2:-$BASE_DIR/raw}
@@ -78,7 +78,7 @@ osh-cpython-configure() {
cpython-configure $PWD/_bin/osh $BASE_DIR/osh-cpython-configure
}
conf-task() {
runtime-task() {
local raw_dir=$1 # output
local job_id=$2
local host=$3
@@ -210,7 +210,7 @@ print-tasks() {
readonly HEADER='status,elapsed_secs,host_name,host_hash,shell_name,shell_hash,task_type,task_arg'
readonly NUM_COLUMNS=7 # 5 from provenence, then task_type / task_arg
all() {
measure() {
local provenance=$1
local raw_dir=${2:-_tmp/osh-runtime/raw}
#local base_dir=${2:-../benchmark-data/osh-parser}
@@ -231,7 +231,7 @@ all() {
# Run them all
#head -n 2 $tasks |
time cat $tasks |
xargs -n $NUM_COLUMNS -- $0 conf-task $raw_dir ||
xargs -n $NUM_COLUMNS -- $0 runtime-task $raw_dir ||
die "Some tasks failed."
cp -v $provenance $raw_dir
@@ -288,7 +288,7 @@ EOF
(powers of 10), not MiB (powers of 2).</p>
EOF
web/table/csv2html.py $in_dir/virtual-memory.csv
csv2html $in_dir/virtual-memory.csv
cat <<EOF
View
@@ -356,7 +356,7 @@ VmBaselineReport = function(in_dir, out_dir) {
spread(key = c(metric_name), value = megabytes) %>%
rename(VmPeak_MB = VmPeak, VmRSS_MB = VmRSS) %>%
select(c(host, shell_name, shell_hash, VmRSS_MB, VmPeak_MB)) %>%
arrange(VmPeak_MB) ->
arrange(host, VmPeak_MB) ->
vm
print(vm)
View
@@ -59,16 +59,20 @@ osh-runtime() {
# NOTE: This is just processing
vm-baseline() {
local base_dir=_tmp/vm-baseine
local base_dir=_tmp/vm-baseline
benchmarks/virtual-memory.sh stage1
benchmarks/vm-baseline.sh stage1
stage2 $base_dir
stage3 $base_dir
}
# This is one is specific to a particular machine.
oheap() {
local base_dir=_tmp/oheap
benchmarks/oheap.sh report
stage2 $base_dir
stage3 $base_dir
}
"$@"
@@ -8,12 +8,13 @@ set -o pipefail
set -o errexit
source test/common.sh # log
source benchmarks/common.sh
readonly BASE_DIR=_tmp/vm-baseline
# TODO: Call this from benchmarks/auto.sh.
vm-baseline() {
measure() {
local provenance=$1
local base_dir=${2:-_tmp/vm-baseline}
#local base_dir=${2:-../benchmark-data/vm-baseline}
@@ -70,6 +71,52 @@ stage1() {
| tee $out/vm-baseline.csv
}
print-report() {
local in_dir=$1
local base_url='../../web/table'
cat <<EOF
<!DOCTYPE html>
<html>
<head>
<title>Virtual Memory Baseline</title>
<script type="text/javascript" src="$base_url/table-sort.js"></script>
<link rel="stylesheet" type="text/css" href="$base_url/table-sort.css" />
<link rel="stylesheet" type="text/css" href="benchmarks.css" />
</head>
<body>
<p id="home-link">
<a href="/">oilshell.org</a>
</p>
<h2>Virtual Memory Baseline</h2>
<h3>Memory Used at Startup (MB)</h3>
<p>Running under <code>osh-ovm</code>. Memory usage is measured in MB
(powers of 10), not MiB (powers of 2).</p>
EOF
csv2html $in_dir/vm-baseline.csv
# TODO: This could be shared with osh-parser and osh-runtime?
cat <<EOF
<!-- <h3>Shell and Host Details</h3> -->
EOF
#csv2html $in_dir/shells.csv
#csv2html $in_dir/hosts.csv
cat <<EOF
</body>
</html>
EOF
}
#
# Other
#
# Demo of the --dump-proc-status-to flag.
# NOTE: Could also add Python introspection.
parser-dump-demo() {

0 comments on commit 58213dd

Please sign in to comment.