Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deps update #368

Merged
merged 6 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: 2

dependencies:

- type: python
path: python/flask/requirements.txt

- type: python
path: python/tornado/requirements.txt

- type: python
path: python/quart/requirements.txt
settings:
python_version: 3.6.6

- type: python
path: python/bottle/requirements.txt

- type: python
path: python/vibora/requirements.txt
settings:
python_version: 3.6.6

- type: python
path: python/aiohttp/requirements.txt
settings:
python_version: 3.6.6

- type: python
path: python/sanic/requirements.txt

- type: python
path: python/japronto/requirements.txt
settiings:
python_version: 3.6.6

- type: python
path: python/django/requirements.txt

- type: js
path: node/restify/package.json

- type: js
path: node/express/package.json

- type: js
path: node/fastify/package.json

- type: js
path: node/hapi/package.json

- type: js
path: node/polka/package.json

- type: js
path: node/koa/package.json

- type: js
path: node/rayo/package.json

- type: php
path: php/symfony/composer.json

- type: php
path: php/laravel/composer.json
4 changes: 2 additions & 2 deletions node/koa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"koa": "2.5.1",
"koa-router": "7.4.0"
"koa": "~2.5.3",
"koa-router": "~7.4.0"
}
}
2 changes: 1 addition & 1 deletion python/japronto/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ COPY requirements.txt server.py ./

EXPOSE 3000

CMD python server.py
CMD python server.py $(nproc)
4 changes: 3 additions & 1 deletion python/japronto/server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from japronto import Application


Expand All @@ -18,4 +20,4 @@ def get_user(request):
app.router.add_route('/user', create_user, 'POST')
app.router.add_route('/user/{id}', get_user, 'GET')

app.run(host='0.0.0.0', port=3000)
app.run(host='0.0.0.0', worker_num=int(sys.argv[1]), port=3000)
6 changes: 2 additions & 4 deletions tools/pipeline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
-- percentile : 99.999

done = function(summary, latency, requests)
file = io.open('/tmp/which_is_the_fastest.out', 'w')

out = {
summary.duration,
Expand All @@ -41,10 +40,9 @@ done = function(summary, latency, requests)

for key, value in pairs(out) do
if key > 1 then
file:write(",")
io.stderr:write(",")
end
file:write(string.format("%d", value))
io.stderr:write(string.format("%d", value))
end

file.close(file)
end
6 changes: 2 additions & 4 deletions tools/pipeline_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
-- percentile : 99.999

done = function(summary, latency, requests)
file = io.open('/tmp/which_is_the_fastest.out', 'w')

out = {
summary.duration,
Expand All @@ -45,10 +44,9 @@ done = function(summary, latency, requests)

for key, value in pairs(out) do
if key > 1 then
file:write(",")
io.stderr:write(",")
end
file:write(string.format("%d", value))
io.stderr:write(string.format("%d", value))
end

file.close(file)
end
27 changes: 10 additions & 17 deletions tools/src/benchmarker.cr
Original file line number Diff line number Diff line change
Expand Up @@ -348,23 +348,16 @@ ranks_by_requests.each do |framework|
puts_markdown "| %-25s | %-25s | %.2f | %.2f MB |" % [framework.target.lang, framework.target.name, result.request.per_second, (result.request.bytes/1000000)], m_lines, true
end

ranks_by_requests.each do |framework|
raw = store.get("#{framework.target.lang}:#{framework.target.name}").as(String)
result = Result.from_json(raw)
puts_markdown "| %-25s | %-25s | %.2f | %.2f MB |" % [framework.target.lang, framework.target.name, result.request.per_second, (result.request.bytes/1000000)], m_lines, true
end


if record
path = File.expand_path("../../../README.md", __FILE__)
tag_from = "<!-- Result from here -->"
tag_till = "<!-- Result till here -->"
m_lines.insert(0, tag_from)
m_lines.push(tag_till)
prev_readme = File.read(path)
next_readme = prev_readme.gsub(
/\<!--\sResult\sfrom\shere\s-->[\s\S]*?<!--\sResult\still\shere\s-->/,
m_lines.join('\n'))
if record
path = File.expand_path("../../../README.md", __FILE__)
tag_from = "<!-- Result from here -->"
tag_till = "<!-- Result till here -->"
m_lines.insert(0, tag_from)
m_lines.push(tag_till)
prev_readme = File.read(path)
next_readme = prev_readme.gsub(
/\<!--\sResult\sfrom\shere\s-->[\s\S]*?<!--\sResult\still\shere\s-->/,
m_lines.join('\n'))

File.write(path, next_readme)
end
9 changes: 5 additions & 4 deletions tools/src/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ class Client

def run
if @method == "POST"
`wrk -H 'Connection: keep-alive' --latency -d #{@duration}s -s #{PIPELINE_POST} -c #{@connections.to_i} --timeout 8 -t #{@threads} #{@url}`
command = "wrk -H 'Connection: keep-alive' --latency -d #{@duration}s -s #{PIPELINE_POST} -c #{@connections.to_i} --timeout 8 -t #{@threads} #{@url}"
else
`wrk -H 'Connection: keep-alive' --latency -d #{@duration}s -s #{PIPELINE_GET} -c #{@connections.to_i} --timeout 8 -t #{@threads} #{@url}`
command = "wrk -H 'Connection: keep-alive' --latency -d #{@duration}s -s #{PIPELINE_GET} -c #{@connections.to_i} --timeout 8 -t #{@threads} #{@url}"
end
io = IO::Memory.new
Process.run(command, shell: true, error: io)

result = File.read("/tmp/which_is_the_fastest.out").split(",")
File.delete("/tmp/which_is_the_fastest.out")
result = io.to_s.split(",")

data = JSON.build do |json|
json.object do
Expand Down