diff --git a/api/api-doc/system.json b/api/api-doc/system.json index 4bcbd10734..3582983b54 100644 --- a/api/api-doc/system.json +++ b/api/api-doc/system.json @@ -224,6 +224,24 @@ "parameters":[] } ] + }, + { + "path":"/system/shard_to_numa_node_mapping", + "operations":[ + { + "method":"GET", + "summary":"Get the shard-to-NUMA-node mapping. The nth element is the NUMA node ID of the nth shard.", + "type":"array", + "items":{ + "type":"long" + }, + "nickname":"get_shard_to_numa_node_mapping", + "produces":[ + "application/json" + ], + "parameters":[] + } + ] } ] } diff --git a/api/system.cc b/api/system.cc index d560a8a86d..e40b5869f2 100644 --- a/api/system.cc +++ b/api/system.cc @@ -197,6 +197,11 @@ void set_system(http_context& ctx, routes& r) { return make_ready_future(seastar::to_sstring(format)); }); }); + + hs::get_shard_to_numa_node_mapping.set(r, [](const_req req) { + auto mapping = local_engine->smp().shard_to_numa_node_mapping(); + return std::vector(mapping.begin(), mapping.end()); + }); } }