Skip to content

Commit 9c6b812

Browse files
authored
Merge pull request #266 from p8/roda/add-upload
Add upload to Roda
2 parents fc6ba22 + 2449781 commit 9c6b812

9 files changed

Lines changed: 470 additions & 31 deletions

File tree

frameworks/roda/app.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ class App < Roda
7272
sio.string
7373
end
7474

75+
r.is 'upload' do
76+
size = 0
77+
buf = request.body
78+
while (chunk = buf.read(65536))
79+
size += chunk.bytesize
80+
end
81+
size.to_s
82+
end
83+
7584
r.is 'db' do
7685
unless opts[:db_available]
7786
response[RodaResponseHeaders::CONTENT_TYPE] = 'application/json'

frameworks/roda/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"noisy",
1313
"limited-conn",
1414
"json",
15+
"upload",
1516
"compression",
1617
"mixed"
1718
]

site/data/current.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"os": "Ubuntu 24.04.4 LTS",
88
"kernel": "6.17.0-19-generic",
99
"docker": "29.3.0",
10-
"commit": "82e5d96",
10+
"commit": "b6fa6b0",
1111
"governor": "performance",
1212
"docker_runtime": "runc",
1313
"threads_per_core": "2",

site/data/upload-256.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -860,21 +860,21 @@
860860
"status_5xx": 0
861861
},
862862
{
863-
"framework": "Fletch",
864-
"language": "Dart",
865-
"rps": 100,
866-
"avg_latency": "1.34s",
867-
"p99_latency": "4.88s",
868-
"cpu": "467.8%",
869-
"memory": "7.9GiB",
863+
"framework": "Roda",
864+
"language": "Ruby",
865+
"rps": 398,
866+
"avg_latency": "610.47ms",
867+
"p99_latency": "1.86s",
868+
"cpu": "11842.4%",
869+
"memory": "16.3GiB",
870870
"connections": 256,
871871
"threads": 64,
872872
"duration": "5s",
873873
"pipeline": 1,
874-
"bandwidth": "19.62KB/s",
875-
"input_bw": "1.95GB/s",
874+
"bandwidth": "33.05KB/s",
875+
"input_bw": "7.77GB/s",
876876
"reconnects": 0,
877-
"status_2xx": 500,
877+
"status_2xx": 1992,
878878
"status_3xx": 0,
879879
"status_4xx": 0,
880880
"status_5xx": 0

site/data/upload-512.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -860,21 +860,21 @@
860860
"status_5xx": 0
861861
},
862862
{
863-
"framework": "Fletch",
864-
"language": "Dart",
865-
"rps": 97,
866-
"avg_latency": "1.62s",
867-
"p99_latency": "5.00s",
868-
"cpu": "442.9%",
869-
"memory": "8.0GiB",
863+
"framework": "Roda",
864+
"language": "Ruby",
865+
"rps": 368,
866+
"avg_latency": "1.15s",
867+
"p99_latency": "4.15s",
868+
"cpu": "11449.1%",
869+
"memory": "16.9GiB",
870870
"connections": 512,
871871
"threads": 64,
872872
"duration": "5s",
873873
"pipeline": 1,
874-
"bandwidth": "19.11KB/s",
875-
"input_bw": "1.89GB/s",
874+
"bandwidth": "30.57KB/s",
875+
"input_bw": "7.19GB/s",
876876
"reconnects": 0,
877-
"status_2xx": 487,
877+
"status_2xx": 1844,
878878
"status_3xx": 0,
879879
"status_4xx": 0,
880880
"status_5xx": 0

site/data/upload-64.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -860,21 +860,21 @@
860860
"status_5xx": 0
861861
},
862862
{
863-
"framework": "Fletch",
864-
"language": "Dart",
865-
"rps": 145,
866-
"avg_latency": "427.12ms",
867-
"p99_latency": "1.62s",
868-
"cpu": "595.7%",
869-
"memory": "6.3GiB",
863+
"framework": "Roda",
864+
"language": "Ruby",
865+
"rps": 412,
866+
"avg_latency": "156.17ms",
867+
"p99_latency": "299.80ms",
868+
"cpu": "5851.0%",
869+
"memory": "12.0GiB",
870870
"connections": 64,
871871
"threads": 64,
872872
"duration": "5s",
873873
"pipeline": 1,
874-
"bandwidth": "28.53KB/s",
875-
"input_bw": "2.83GB/s",
874+
"bandwidth": "34.19KB/s",
875+
"input_bw": "8.05GB/s",
876876
"reconnects": 0,
877-
"status_2xx": 727,
877+
"status_2xx": 2061,
878878
"status_3xx": 0,
879879
"status_4xx": 0,
880880
"status_5xx": 0
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
[1] Puma starting in cluster mode...
2+
[1] * Puma version: 7.2.0 ("On The Corner")
3+
[1] * Ruby version: ruby 4.0.2 (2026-03-17 revision d3da9fec82) +YJIT +MN +PRISM [x86_64-linux]
4+
[1] * Min threads: 4
5+
[1] * Max threads: 4
6+
[1] * Environment: production
7+
[1] * Master PID: 1
8+
[1] * Workers: 128
9+
[1] * Restarts: (✔) hot (✖) phased (✖) refork
10+
[1] * Preloading application
11+
[1] * Listening on http://0.0.0.0:8080
12+
[1] Use Ctrl-C to stop
13+
[1] ! WARNING: Detected `RUBY_MN_THREADS=1`
14+
[1] ! This setting is known to cause performance regressions with Puma.
15+
[1] ! Consider disabling this environment variable: https://github.com/puma/puma/issues/3720
16+
[1] - Worker 0 (PID: 8) booted in 0.21s, phase: 0
17+
[1] - Worker 1 (PID: 12) booted in 0.21s, phase: 0
18+
[1] - Worker 2 (PID: 16) booted in 0.21s, phase: 0
19+
[1] - Worker 3 (PID: 20) booted in 0.2s, phase: 0
20+
[1] - Worker 4 (PID: 24) booted in 0.2s, phase: 0
21+
[1] - Worker 5 (PID: 28) booted in 0.2s, phase: 0
22+
[1] - Worker 6 (PID: 32) booted in 0.2s, phase: 0
23+
[1] - Worker 7 (PID: 37) booted in 0.2s, phase: 0
24+
[1] - Worker 8 (PID: 42) booted in 0.2s, phase: 0
25+
[1] - Worker 9 (PID: 46) booted in 0.2s, phase: 0
26+
[1] - Worker 10 (PID: 51) booted in 0.2s, phase: 0
27+
[1] - Worker 11 (PID: 56) booted in 0.2s, phase: 0
28+
[1] - Worker 12 (PID: 63) booted in 0.19s, phase: 0
29+
[1] - Worker 13 (PID: 68) booted in 0.19s, phase: 0
30+
[1] - Worker 14 (PID: 78) booted in 0.19s, phase: 0
31+
[1] - Worker 15 (PID: 84) booted in 0.19s, phase: 0
32+
[1] - Worker 16 (PID: 89) booted in 0.19s, phase: 0
33+
[1] - Worker 17 (PID: 94) booted in 0.19s, phase: 0
34+
[1] - Worker 18 (PID: 101) booted in 0.18s, phase: 0
35+
[1] - Worker 19 (PID: 106) booted in 0.18s, phase: 0
36+
[1] - Worker 20 (PID: 111) booted in 0.18s, phase: 0
37+
[1] - Worker 21 (PID: 116) booted in 0.18s, phase: 0
38+
[1] - Worker 22 (PID: 122) booted in 0.18s, phase: 0
39+
[1] - Worker 23 (PID: 128) booted in 0.18s, phase: 0
40+
[1] - Worker 24 (PID: 133) booted in 0.18s, phase: 0
41+
[1] - Worker 25 (PID: 139) booted in 0.18s, phase: 0
42+
[1] - Worker 26 (PID: 144) booted in 0.18s, phase: 0
43+
[1] - Worker 27 (PID: 150) booted in 0.18s, phase: 0
44+
[1] - Worker 28 (PID: 155) booted in 0.17s, phase: 0
45+
[1] - Worker 29 (PID: 163) booted in 0.17s, phase: 0
46+
[1] - Worker 30 (PID: 175) booted in 0.17s, phase: 0
47+
[1] - Worker 31 (PID: 180) booted in 0.17s, phase: 0
48+
[1] - Worker 32 (PID: 186) booted in 0.17s, phase: 0
49+
[1] - Worker 33 (PID: 191) booted in 0.17s, phase: 0
50+
[1] - Worker 34 (PID: 196) booted in 0.16s, phase: 0
51+
[1] - Worker 35 (PID: 202) booted in 0.16s, phase: 0
52+
[1] - Worker 36 (PID: 207) booted in 0.16s, phase: 0
53+
[1] - Worker 37 (PID: 212) booted in 0.16s, phase: 0
54+
[1] - Worker 38 (PID: 217) booted in 0.16s, phase: 0
55+
[1] - Worker 39 (PID: 225) booted in 0.16s, phase: 0
56+
[1] - Worker 40 (PID: 231) booted in 0.15s, phase: 0
57+
[1] - Worker 41 (PID: 238) booted in 0.15s, phase: 0
58+
[1] - Worker 42 (PID: 242) booted in 0.15s, phase: 0
59+
[1] - Worker 43 (PID: 248) booted in 0.15s, phase: 0
60+
[1] - Worker 44 (PID: 255) booted in 0.15s, phase: 0
61+
[1] - Worker 45 (PID: 259) booted in 0.15s, phase: 0
62+
[1] - Worker 46 (PID: 266) booted in 0.15s, phase: 0
63+
[1] - Worker 47 (PID: 271) booted in 0.14s, phase: 0
64+
[1] - Worker 48 (PID: 277) booted in 0.14s, phase: 0
65+
[1] - Worker 49 (PID: 283) booted in 0.14s, phase: 0
66+
[1] - Worker 50 (PID: 288) booted in 0.14s, phase: 0
67+
[1] - Worker 51 (PID: 294) booted in 0.14s, phase: 0
68+
[1] - Worker 52 (PID: 299) booted in 0.14s, phase: 0
69+
[1] - Worker 53 (PID: 304) booted in 0.14s, phase: 0
70+
[1] - Worker 54 (PID: 310) booted in 0.14s, phase: 0
71+
[1] - Worker 55 (PID: 315) booted in 0.13s, phase: 0
72+
[1] - Worker 56 (PID: 321) booted in 0.13s, phase: 0
73+
[1] - Worker 57 (PID: 327) booted in 0.13s, phase: 0
74+
[1] - Worker 58 (PID: 333) booted in 0.13s, phase: 0
75+
[1] - Worker 59 (PID: 338) booted in 0.13s, phase: 0
76+
[1] - Worker 60 (PID: 344) booted in 0.13s, phase: 0
77+
[1] - Worker 61 (PID: 350) booted in 0.13s, phase: 0
78+
[1] - Worker 62 (PID: 356) booted in 0.13s, phase: 0
79+
[1] - Worker 63 (PID: 362) booted in 0.12s, phase: 0
80+
[1] - Worker 64 (PID: 368) booted in 0.12s, phase: 0
81+
[1] - Worker 65 (PID: 374) booted in 0.12s, phase: 0
82+
[1] - Worker 66 (PID: 380) booted in 0.12s, phase: 0
83+
[1] - Worker 67 (PID: 386) booted in 0.12s, phase: 0
84+
[1] - Worker 68 (PID: 392) booted in 0.12s, phase: 0
85+
[1] - Worker 69 (PID: 398) booted in 0.12s, phase: 0
86+
[1] - Worker 70 (PID: 404) booted in 0.12s, phase: 0
87+
[1] - Worker 71 (PID: 410) booted in 0.11s, phase: 0
88+
[1] - Worker 72 (PID: 416) booted in 0.11s, phase: 0
89+
[1] - Worker 73 (PID: 422) booted in 0.11s, phase: 0
90+
[1] - Worker 74 (PID: 428) booted in 0.11s, phase: 0
91+
[1] - Worker 75 (PID: 434) booted in 0.11s, phase: 0
92+
[1] - Worker 76 (PID: 440) booted in 0.11s, phase: 0
93+
[1] - Worker 77 (PID: 446) booted in 0.11s, phase: 0
94+
[1] - Worker 78 (PID: 452) booted in 0.11s, phase: 0
95+
[1] - Worker 79 (PID: 458) booted in 0.1s, phase: 0
96+
[1] - Worker 80 (PID: 464) booted in 0.1s, phase: 0
97+
[1] - Worker 81 (PID: 470) booted in 0.1s, phase: 0
98+
[1] - Worker 82 (PID: 476) booted in 0.1s, phase: 0
99+
[1] - Worker 83 (PID: 482) booted in 0.1s, phase: 0
100+
[1] - Worker 84 (PID: 488) booted in 0.1s, phase: 0
101+
[1] - Worker 85 (PID: 494) booted in 0.1s, phase: 0
102+
[1] - Worker 86 (PID: 500) booted in 0.09s, phase: 0
103+
[1] - Worker 87 (PID: 506) booted in 0.09s, phase: 0
104+
[1] - Worker 88 (PID: 512) booted in 0.11s, phase: 0
105+
[1] - Worker 89 (PID: 518) booted in 0.1s, phase: 0
106+
[1] - Worker 90 (PID: 524) booted in 0.1s, phase: 0
107+
[1] - Worker 91 (PID: 530) booted in 0.1s, phase: 0
108+
[1] - Worker 92 (PID: 536) booted in 0.1s, phase: 0
109+
[1] - Worker 93 (PID: 543) booted in 0.1s, phase: 0
110+
[1] - Worker 94 (PID: 548) booted in 0.1s, phase: 0
111+
[1] - Worker 95 (PID: 554) booted in 0.1s, phase: 0
112+
[1] - Worker 96 (PID: 560) booted in 0.09s, phase: 0
113+
[1] - Worker 97 (PID: 567) booted in 0.09s, phase: 0
114+
[1] - Worker 98 (PID: 573) booted in 0.09s, phase: 0
115+
[1] - Worker 99 (PID: 579) booted in 0.09s, phase: 0
116+
[1] - Worker 100 (PID: 584) booted in 0.09s, phase: 0
117+
[1] - Worker 101 (PID: 591) booted in 0.09s, phase: 0
118+
[1] - Worker 102 (PID: 597) booted in 0.09s, phase: 0
119+
[1] - Worker 103 (PID: 602) booted in 0.09s, phase: 0
120+
[1] - Worker 104 (PID: 608) booted in 0.08s, phase: 0
121+
[1] - Worker 105 (PID: 614) booted in 0.08s, phase: 0
122+
[1] - Worker 106 (PID: 620) booted in 0.08s, phase: 0
123+
[1] - Worker 107 (PID: 627) booted in 0.08s, phase: 0
124+
[1] - Worker 108 (PID: 633) booted in 0.08s, phase: 0
125+
[1] - Worker 109 (PID: 638) booted in 0.08s, phase: 0
126+
[1] - Worker 110 (PID: 644) booted in 0.08s, phase: 0
127+
[1] - Worker 111 (PID: 650) booted in 0.08s, phase: 0
128+
[1] - Worker 112 (PID: 656) booted in 0.07s, phase: 0
129+
[1] - Worker 113 (PID: 662) booted in 0.07s, phase: 0
130+
[1] - Worker 114 (PID: 668) booted in 0.07s, phase: 0
131+
[1] - Worker 115 (PID: 674) booted in 0.07s, phase: 0
132+
[1] - Worker 116 (PID: 680) booted in 0.07s, phase: 0
133+
[1] - Worker 117 (PID: 686) booted in 0.07s, phase: 0
134+
[1] - Worker 118 (PID: 692) booted in 0.07s, phase: 0
135+
[1] - Worker 119 (PID: 698) booted in 0.07s, phase: 0
136+
[1] - Worker 120 (PID: 704) booted in 0.06s, phase: 0
137+
[1] - Worker 121 (PID: 710) booted in 0.06s, phase: 0
138+
[1] - Worker 122 (PID: 716) booted in 0.06s, phase: 0
139+
[1] - Worker 123 (PID: 722) booted in 0.06s, phase: 0
140+
[1] - Worker 124 (PID: 728) booted in 0.06s, phase: 0
141+
[1] - Worker 125 (PID: 734) booted in 0.06s, phase: 0
142+
[1] - Worker 126 (PID: 740) booted in 0.06s, phase: 0
143+
[1] - Worker 127 (PID: 746) booted in 0.05s, phase: 0

0 commit comments

Comments
 (0)