-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinefile-posts.toml
More file actions
50 lines (44 loc) · 1.03 KB
/
finefile-posts.toml
File metadata and controls
50 lines (44 loc) · 1.03 KB
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
43
44
45
46
47
48
49
50
[defaults.commands]
command = """eval "$CRAWL_POSTS" """
export-json = "bench-posts.json"
min-runs = 5
timeout-seconds = 1800
warmup-runs = 1
[defaults.commands.env]
COMMON_SETUP = """
cd dev
nix run . -- down || true
rm -rf data
nix run . --impure -- up --detach-on-success --detached-with-tui
cd ..
eval "$GENERATE_POSTS"
pushd "$WPDIR"
"""
CRAWL_POSTS = """
popd
URLS="$(mktemp)"
cat > "$URLS" <<EOF
$SERVER_URL/
$SERVER_URL/author/user/
$SERVER_URL/author/user/page/1/
$SERVER_URL/not-found/
$SERVER_URL/sample-page/
$SERVER_URL/wp-sitemap.xml
EOF
for i in {1..20}; do
echo "$SERVER_URL/category/category-$i/" >> "$URLS"
for j in {1..10}; do
echo "$SERVER_URL/category/category-$i/page/$j/" >> "$URLS"
done
done
for i in {1..1000}; do
echo "$SERVER_URL/sample-post-$i/" >> "$URLS"
done
php src/scramble-lines-zipf.php "$URLS" 5000 < "$URLS" > "$URLS.tmp"
mv "$URLS.tmp" "$URLS"
siege --benchmark --no-parser -c 50 -r 100 -f "$URLS"
rm "$URLS"
"""
GENERATE_POSTS = """
wp --path="$WPDIR" eval-file src/generate-posts.php
"""