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
leda micro framework #887
Merged
aschneider-techempower
merged 35 commits into
TechEmpower:master
from
unknown repository
Jul 21, 2014
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
e2d2b25
adding test for leda micro framework
sarquaz 1a05a70
updating readme
sarquaz f02aec7
updating readme
sarquaz 94637d0
updating readme
sarquaz 58ce742
updating language
sarquaz 1e66e0f
updating code to use lua
sarquaz 6279b9d
adding server as callback parameter
sarquaz 7231c68
updating readme
sarquaz e57c566
updating to use latest api
sarquaz e974bb8
merge upstream
sarquaz 73c4fc0
updating to meet requirements
sarquaz 561a2f5
fix name
sarquaz 2e1fb21
fix newline
sarquaz 22dfd04
fixing typo and moving file
sarquaz dccd8dc
refactored to add else clause
sarquaz 8f11ad4
refactored to add caching
sarquaz 6ce8de1
update setup script
sarquaz 645e94d
update setup script
sarquaz 040651d
update setup script
sarquaz c9367eb
update setup script
sarquaz cb68524
updates to code and install script
sarquaz 16db64a
changing install script mode
sarquaz ee92499
flags to apt-get
sarquaz 4d3b0af
changing install script mode
sarquaz bed4d00
updating serup script
sarquaz 2ed6dae
updating config
sarquaz ce5a31f
updating config
sarquaz 2d762b3
removing standard libevent headers
sarquaz 2345c6e
removing standard libevent headers
sarquaz 9c2b0e6
removing the wrong commands
sarquaz 8633df3
making required changes
sarquaz cf3f076
updating version
sarquaz 2629467
updates
sarquaz 2ddbf3c
updates
sarquaz 9c90f4a
updates
sarquaz
Jump to file or symbol
Failed to load files and symbols.
Diff settings
| @@ -0,0 +1,23 @@ | ||
| # Leda Benchmark Test | ||
| ### Deployment | ||
| [Leda](https://github.com/sergeyzavadski/leda) framework has to set up. | ||
| ### JSON Encoding Test | ||
| * [Source](app.lua) | ||
| ## Test URLs | ||
| ### JSON Encoding | ||
| http://localhost:8080/json | ||
| ### Plaintext | ||
| http://localhost:8080/plaintext |
No changes.
14
leda/app.lua
| @@ -0,0 +1,14 @@ | ||
| local http = require('leda.http') | ||
| local json = require('cjson') | ||
| local server = http.Server(8080, '') | ||
| server.request = function(server, request, response) | ||
| local url = request:url() | ||
| if url:find('/json') then | ||
| response.body = json.encode{message= 'Hello, World!'} | ||
| response.headers['Content-Type'] = 'application/json' | ||
| elseif url:find('/plaintext') then | ||
| response.body = 'Hello, World!' | ||
| end | ||
| end |
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "framework": "leda", | ||
| "tests": [{ | ||
| "default": { | ||
| "setup_file": "setup", | ||
| "json_url": "/json", | ||
| "plaintext_url": "/plaintext", | ||
| "port": 8080, | ||
| "approach": "Realistic", | ||
| "classification": "Micro", | ||
| "database": "None", | ||
| "framework": "leda", | ||
| "language": "lua", | ||
| "orm": "Raw", | ||
| "platform": "libpropeller", | ||
| "webserver": "None", | ||
| "os": "Linux", | ||
| "database_os": "Linux", | ||
| "display_name": "leda", | ||
| "notes": "", | ||
| "versus": "" | ||
| } | ||
| }] | ||
| } |
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| fw_depends leda |
| @@ -0,0 +1,24 @@ | ||
| import subprocess | ||
| import sys | ||
| import setup_util | ||
| import os | ||
| def start(args, logfile, errfile): | ||
| subprocess.Popen('leda app.lua', shell=True, cwd="leda", stderr=errfile, stdout=logfile) | ||
| return 0 | ||
| def stop(logfile, errfile): | ||
| p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE) | ||
| out, err = p.communicate() | ||
| for line in out.splitlines(): | ||
| if 'app.lua' in line: | ||
| try: | ||
| pid = int(line.split(None, 2)[1]) | ||
| os.kill(pid, 15) | ||
| except OSError: | ||
| pass | ||
| return 0 |
| @@ -0,0 +1 @@ | ||
| ./leda/app.lua |
| @@ -0,0 +1,23 @@ | ||
| #!/bin/bash | ||
| RETCODE=$(fw_exists leda) | ||
| [ ! "$RETCODE" == 0 ] || { return 0; } | ||
| rm -rf leda || true | ||
| sudo apt-get install -y g++ | ||
| sudo apt-get install -y luarocks | ||
| sudo luarocks install lua-cjson | ||
| wget -O leda.tar.gz http://sergeyzavadski.github.io/leda/releases/leda-0.5.4/leda-0.5.4.tar.gz | ||
| fw_untar leda.tar.gz | ||
| cd leda-0.5.4 | ||
| ./configure | ||
| make | ||
| sudo make install | ||
| cd .. | ||
| mv leda-0.5.4 leda | ||
ProTip!
Use n and p to navigate between commits in a pull request.