Skip to content

Commit 3a4c175

Browse files
committed
apps: httpd: add /shard endpoint
Useful for testing connection load-balancing algorithms.
1 parent 90565df commit 3a4c175

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/httpd/main.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ void set_routes(routes& r) {
6262
r.add(operation_type::GET, url("/jf"), h2);
6363
r.add(operation_type::GET, url("/file").remainder("path"),
6464
new directory_handler("/"));
65+
r.add(operation_type::GET, url("/shard"), new function_handler([] (const_req req) {
66+
return seastar::sstring(fmt::format("{}", seastar::this_shard_id()));
67+
}));
6568
demo_json::hello_world.set(r, [] (const_req req) {
6669
demo_json::my_object obj;
6770
obj.var1 = req.param.at("var1");

0 commit comments

Comments
 (0)