-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tilecache: add basic performance monitor script
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| %{time_total},%{http_code},%{url_effective},%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer}\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
cookbooks/tilecache/templates/default/tilecache-curl-time.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/bash | ||
| mkdir -p /src/tilecache/data/$(date --utc "+%Y/%m") | ||
| <% @caches.each do |cache| -%> | ||
| <% if cache[:hostname] != node[:hostname] -%> | ||
| <% cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address| -%> | ||
| curl -w "@/src/tilecache/tilecache-curl-time.txt" -o /dev/null -s -k -4 \ | ||
| 'https://<%= cache[:hostname] %>/19/262106/174485.png' \ | ||
| -H 'authority: c.tile.openstreetmap.org' \ | ||
| -H 'sec-fetch-dest: image' \ | ||
| -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36' \ | ||
| -H 'dnt: 1' \ | ||
| -H 'accept: image/webp,image/apng,image/*,*/*;q=0.8' \ | ||
| -H 'sec-fetch-site: same-site' \ | ||
| -H 'sec-fetch-mode: no-cors' \ | ||
| -H 'referer: https://www.openstreetmap.org/' \ | ||
| -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \ | ||
| --compressed | tee -a /src/tilecache/data/$(date --utc "+%Y/%m")/tilecache-<%= render[:hostname] %>-$(date --utc --iso-8601).txt | ||
| <% end -%> | ||
| <% end -%> | ||
| <% end -%> | ||
| <% @renders.each do |render| -%> | ||
| <% if render[:hostname] != node[:hostname] -%> | ||
| <% render.ipaddresses(:family => :inet, :role => :external).sort.each do |address| -%> | ||
| curl -w "@/src/tilecache/tilecache-curl-time.txt" -o /dev/null -s -k -4 \ | ||
| 'https://<%= render[:hostname] %>/19/262106/174485.png' \ | ||
| -H 'authority: c.tile.openstreetmap.org' \ | ||
| -H 'sec-fetch-dest: image' \ | ||
| -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36' \ | ||
| -H 'dnt: 1' \ | ||
| -H 'accept: image/webp,image/apng,image/*,*/*;q=0.8' \ | ||
| -H 'sec-fetch-site: same-site' \ | ||
| -H 'sec-fetch-mode: no-cors' \ | ||
| -H 'referer: https://www.openstreetmap.org/' \ | ||
| -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \ | ||
| --compressed | tee -a /src/tilecache/data/$(date --utc "+%Y/%m")/render-<%= render[:hostname] %>-$(date --utc --iso-8601).txt | ||
| <% end -%> | ||
| <% end -%> | ||
| <% end -%> |