This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds jmeter for #296 caching, initial test for endpoints at 104
- Loading branch information
1 parent
43af28a
commit 3e9cfc6
Showing
10 changed files
with
42,938 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
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
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
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,12 @@ | ||
Label,# Samples,Average,Min,Max,Std. Dev.,Error %,Throughput,KB/sec,Avg. Bytes | ||
JSON,358,956,95,1501,273.7,0.00%,5.9,56.32,9734.8 | ||
DocumentCloud Home,251,1187,173,2501,734.89,0.00%,4.1,50.59,12568.8 | ||
JSON with callback,355,903,98,1353,295.25,0.00%,5.9,56.03,9692.7 | ||
JS,347,91,81,190,9.3,0.00%,5.9,53.82,9381 | ||
Iframe embed page,346,846,89,1303,281.06,0.00%,5.8,22.53,3988 | ||
Iframe embed page embed params,339,856,91,1248,281.27,0.00%,5.7,10.27,1844 | ||
Iframe embed document,335,875,91,1397,272.82,0.00%,5.6,16.97,3086 | ||
Iframe embed document with embed params,327,882,102,1195,268.15,100.00%,5.5,7.11,1325 | ||
oEmbed,319,859,89,1234,269.85,0.00%,5.4,14.28,2716 | ||
oEmbed with responsive params,315,861,88,1186,265.37,0.00%,5.3,14.45,2778 | ||
TOTAL,3292,821,81,2501,417.04,9.93%,54.1,297.45,5634.7 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,51 @@ | ||
require 'rubygems' | ||
require 'ruby-jmeter' | ||
|
||
test do | ||
threads count: 5 do | ||
visit name: 'DocumentCloud Home', url: 'https://staging.documentcloud.org' | ||
end | ||
|
||
|
||
threads count: 50 do | ||
# 296 Reliably cache/expire: | ||
# JS/JSON endpoints | ||
visit name: 'JSON', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis.json' | ||
visit name: 'JSON with callback', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis.json?callback=foo' | ||
visit name: 'JS', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis.js' | ||
# Iframe embed show pages | ||
visit name: 'Iframe embed page', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis/pages/57.html' | ||
visit name: 'Iframe embed page embed params', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis/pages/57.html?embed=true' | ||
visit name: 'Iframe embed document', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis/annotations/42282.html' | ||
visit name: 'Iframe embed document with embed params', url: 'https://staging.documentcloud.org/documents/282753-lefler-thesis/annotations/42282.html?embed=true' | ||
# oEmbed endpoints | ||
visit name: 'oEmbed', url: 'https://staging.documentcloud.org/api/oembed.json?url=https%3A%2F%2Fstaging.documentcloud.org%2Fdocuments%2F282753-lefler-thesis%2Fannotations%2F42282.html' | ||
visit name: 'oEmbed with responsive params', | ||
url: 'https://staging.documentcloud.org/api/oembed.json?url=https%3A%2F%2Fstaging.documentcloud.org%2Fdocuments%2F282753-lefler-thesis.html&responsive=true' | ||
end | ||
|
||
cache use_expires: true, clear_each_iteration: true | ||
|
||
generate_summary_results | ||
|
||
latencies_over_time 'Response Latencies Over Time' | ||
|
||
active_threads 'Active Threads' | ||
|
||
composite 'Composite Graph', [ | ||
{ | ||
graph: 'Response Latencies Over Time', | ||
metric: 'Home Page' | ||
}, | ||
{ | ||
graph: 'Active Threads', | ||
metric: 'Overall Active Threads' | ||
} | ||
] | ||
|
||
end.run( | ||
path: '/usr/local/bin/', #'/usr/bin/', , #adjust path to jmeter | ||
file: './benchmarks/296_cache/testplan.jmx', | ||
log: './log/jmeter.log', | ||
jtl: './benchmarks/296_cache/results-staging.jtl') | ||
#properties: './benchmarks/jmeter/user.properties') |
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,41 @@ | ||
### Benchmark Tests | ||
|
||
Using Apache's JMeter framework, a Java application designed to load test functional behavior and measure performance. | ||
|
||
http://jmeter.apache.org/ | ||
|
||
|
||
## Installation | ||
|
||
### ubuntu | ||
`sudo apt-get install jmeter` | ||
|
||
### OSX | ||
|
||
`brew install jmeter --with-plugins` | ||
|
||
To open the GUI | ||
`open /usr/local/bin/jmeter` | ||
|
||
JMeter load tests are XML files. The ruby-jmeter DSL facilitatles test plan creation | ||
using ruby. | ||
|
||
https://github.com/flood-io/ruby-jmeter | ||
|
||
### Runing the testplan | ||
|
||
ruby path/to/testplan.rb | ||
|
||
Also, there is a rake task to generate test plan and run the test. | ||
|
||
`bundle exec rake benchmark:run_testplan path/to/testplan.rb` | ||
|
||
### Reports | ||
|
||
@TODO Rake task to generate reports | ||
|
||
`bundle exec rake benchmark:generate_report pluginType path/to/results/file.rb` | ||
|
||
## Example | ||
|
||
See benchmark/296_cache/testplan.rb |
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,5 @@ | ||
CookieManager.delete_null_cookies=false | ||
CookieManager.save.cookies=true | ||
jmeter.save.saveservice.url=true | ||
jmeter.save.saveservice.requestHeaders=true | ||
jmeter.save.saveservice.autoflush=true |
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,9 @@ | ||
namespace :benchmark do | ||
|
||
desc "Run jmeter test plan and output results" | ||
task :run_testplan, [:filename] => [:environment] do |t, args| | ||
raise "You need to install jmeter, see http://jmeter.apache.org/" if !system('which jmeter') | ||
#raise "Specify full path to ruby-jmeter rb file" if filename.blank? | ||
system('ruby #{filename}') | ||
end | ||
end |