Skip to content
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
17 changes: 9 additions & 8 deletions frameworks/roda/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ def render_plain(plain)

def map_row(row)
mapped_row = {
id: row['id'],
name: row['name'],
category: row['category'],
price: row['price'],
quantity: row['quantity'],
active: row['active'] == 1,
id: row[:id],
name: row[:name],
category: row[:category],
price: row[:price],
quantity: row[:quantity],
active: row[:active] == 1,
}
mapped_row[:tags] = JSON.parse(row['tags']) if row['tags']
mapped_row[:rating] = { score: row['rating_score'], count: row['rating_count'] } if row['rating_score'] && row['rating_count']
mapped_row[:tags] = JSON.parse(row[:tags]) if row[:tags]
mapped_row[:rating] = { score: row[:rating_score], count: row[:rating_count] } if row[:rating_score] && row[:rating_count]
mapped_row
end

Expand All @@ -233,6 +233,7 @@ def self.get_async_db
max_connections = ENV.fetch('MAX_THREADS', 4).to_i
ConnectionPool.new(size: max_connections, timeout: 5) do
db = PG.connect(ENV['DATABASE_URL'])
db.field_name_type = :symbol
db.prepare('select', SELECT_QUERY)
db.prepare('crud_get', CRUD_GET_SQL)
db.prepare('crud_list', CRUD_LIST_SQL)
Expand Down
24 changes: 12 additions & 12 deletions site/data/api-16-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -854,28 +854,28 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 46256,
"avg_latency": "20.86ms",
"p99_latency": "78.70ms",
"cpu": "1677.9%",
"memory": "1.5GiB",
"rps": 49742,
"avg_latency": "19.24ms",
"p99_latency": "80.90ms",
"cpu": "1694.0%",
"memory": "1.6GiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "238.33MB/s",
"input_bw": "2.60MB/s",
"reconnects": 138616,
"status_2xx": 693845,
"bandwidth": "255.56MB/s",
"input_bw": "2.80MB/s",
"reconnects": 149160,
"status_2xx": 746138,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 260094,
"tpl_json": 260288,
"tpl_baseline": 279836,
"tpl_json": 279980,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 173462
"tpl_async_db": 186320
},
{
"framework": "servicestack",
Expand Down
22 changes: 11 additions & 11 deletions site/data/api-4-256.json
Original file line number Diff line number Diff line change
Expand Up @@ -854,28 +854,28 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 18581,
"avg_latency": "12.94ms",
"p99_latency": "53.40ms",
"rps": 19893,
"avg_latency": "11.79ms",
"p99_latency": "53.90ms",
"cpu": "396.3%",
"memory": "491MiB",
"memory": "521MiB",
"connections": 256,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "95.79MB/s",
"input_bw": "1.05MB/s",
"reconnects": 55738,
"status_2xx": 278727,
"bandwidth": "102.23MB/s",
"input_bw": "1.12MB/s",
"reconnects": 59636,
"status_2xx": 298405,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 104382,
"tpl_json": 104559,
"tpl_baseline": 111884,
"tpl_json": 111993,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 69786
"tpl_async_db": 74528
},
{
"framework": "servicestack",
Expand Down
16 changes: 8 additions & 8 deletions site/data/async-db-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,19 +676,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 107840,
"avg_latency": "8.81ms",
"p99_latency": "21.90ms",
"cpu": "6296.7%",
"rps": 117100,
"avg_latency": "8.14ms",
"p99_latency": "20.40ms",
"cpu": "6322.4%",
"memory": "2.5GiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "437.29MB/s",
"input_bw": "7.20MB/s",
"reconnects": 42742,
"status_2xx": 1078403,
"bandwidth": "473.34MB/s",
"input_bw": "7.82MB/s",
"reconnects": 46608,
"status_2xx": 1171001,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/baseline-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -1009,19 +1009,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 51841,
"avg_latency": "68.08ms",
"p99_latency": "301.40ms",
"cpu": "4003.9%",
"memory": "8.6GiB",
"rps": 58070,
"avg_latency": "58.92ms",
"p99_latency": "288.70ms",
"cpu": "4058.5%",
"memory": "8.4GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "5.09MB/s",
"input_bw": "4.00MB/s",
"bandwidth": "4.93MB/s",
"input_bw": "4.49MB/s",
"reconnects": 0,
"status_2xx": 259209,
"status_2xx": 290350,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/baseline-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -1009,19 +1009,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 98502,
"avg_latency": "5.18ms",
"p99_latency": "84.50ms",
"cpu": "4756.6%",
"memory": "9.6GiB",
"rps": 101628,
"avg_latency": "5.04ms",
"p99_latency": "82.20ms",
"cpu": "4685.8%",
"memory": "9.2GiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "9.67MB/s",
"input_bw": "7.61MB/s",
"reconnects": 430,
"status_2xx": 492512,
"bandwidth": "8.62MB/s",
"input_bw": "7.85MB/s",
"reconnects": 449,
"status_2xx": 508141,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/crud-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 60025,
"avg_latency": "65.23ms",
"p99_latency": "83.00ms",
"cpu": "2591.6%",
"memory": "3.3GiB",
"rps": 60814,
"avg_latency": "64.82ms",
"p99_latency": "85.00ms",
"cpu": "2561.5%",
"memory": "3.4GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "19.17MB/s",
"input_bw": "5.15MB/s",
"reconnects": 3340,
"status_2xx": 900375,
"bandwidth": "19.48MB/s",
"input_bw": "5.22MB/s",
"reconnects": 3654,
"status_2xx": 912215,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,19 +776,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 229571,
"avg_latency": "15.79ms",
"p99_latency": "44.40ms",
"cpu": "6386.4%",
"memory": "4.4GiB",
"rps": 250044,
"avg_latency": "14.41ms",
"p99_latency": "41.60ms",
"cpu": "6380.6%",
"memory": "4.3GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "794.18MB/s",
"input_bw": "10.95MB/s",
"reconnects": 43984,
"status_2xx": 1147856,
"bandwidth": "861.77MB/s",
"input_bw": "11.92MB/s",
"reconnects": 48054,
"status_2xx": 1250224,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-comp-16384.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,19 +642,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 130203,
"avg_latency": "87.05ms",
"p99_latency": "320.00ms",
"cpu": "6254.7%",
"memory": "4.5GiB",
"rps": 141455,
"avg_latency": "65.01ms",
"p99_latency": "225.80ms",
"cpu": "6242.6%",
"memory": "5.5GiB",
"connections": 16384,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "175.63MB/s",
"input_bw": "9.69MB/s",
"reconnects": 19323,
"status_2xx": 651016,
"bandwidth": "188.81MB/s",
"input_bw": "10.52MB/s",
"reconnects": 23508,
"status_2xx": 707279,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-comp-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,19 +642,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 131424,
"avg_latency": "26.84ms",
"p99_latency": "51.10ms",
"cpu": "6538.8%",
"memory": "3.7GiB",
"rps": 142219,
"avg_latency": "25.69ms",
"p99_latency": "50.40ms",
"cpu": "6432.3%",
"memory": "5.1GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "177.21MB/s",
"input_bw": "9.78MB/s",
"reconnects": 24296,
"status_2xx": 657123,
"bandwidth": "189.80MB/s",
"input_bw": "10.58MB/s",
"reconnects": 26542,
"status_2xx": 711095,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/json-comp-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,19 +642,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 127706,
"avg_latency": "4.00ms",
"p99_latency": "17.20ms",
"cpu": "6380.1%",
"memory": "4.0GiB",
"rps": 129351,
"avg_latency": "3.95ms",
"p99_latency": "13.10ms",
"cpu": "6421.7%",
"memory": "3.4GiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "172.27MB/s",
"input_bw": "9.50MB/s",
"reconnects": 25432,
"status_2xx": 638531,
"bandwidth": "172.75MB/s",
"input_bw": "9.62MB/s",
"reconnects": 25856,
"status_2xx": 646759,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/json-tls-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,18 +386,18 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 210033,
"avg_latency": "19.43ms",
"p99_latency": "19.43ms",
"cpu": "6602.7%",
"memory": "5.3GiB",
"rps": 220981,
"avg_latency": "18.65ms",
"p99_latency": "18.65ms",
"cpu": "6499.2%",
"memory": "6.5GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "726.84MB",
"bandwidth": "761.80MB",
"reconnects": 0,
"status_2xx": 1071253,
"status_2xx": 1126641,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
18 changes: 9 additions & 9 deletions site/data/limited-conn-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -1009,19 +1009,19 @@
{
"framework": "roda",
"language": "Ruby",
"rps": 28872,
"avg_latency": "122.82ms",
"p99_latency": "314.80ms",
"cpu": "3546.3%",
"memory": "6.6GiB",
"rps": 28610,
"avg_latency": "133.26ms",
"p99_latency": "272.10ms",
"cpu": "3393.4%",
"memory": "6.4GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "2.83MB/s",
"input_bw": "2.23MB/s",
"reconnects": 12639,
"status_2xx": 144360,
"bandwidth": "2.43MB/s",
"input_bw": "2.21MB/s",
"reconnects": 12539,
"status_2xx": 143050,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
Loading