Skip to content

Commit db6c1e9

Browse files
committed
changed query SHOW TAG VALUES FROM calibs WITH KEY
1 parent 19b6690 commit db6c1e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/15-ODC.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ void httpServer(tcp::acceptor& acceptor, tcp::socket& socket) {
5454
response.set(http::field::content_type, "application/json");
5555
beast::ostream(response.body()) << R"({"results":[{"statement_id":0,"series":[{"name":"measurements","columns":["name"],"values":[["odc"]]}]}]}\n)";
5656
});
57-
connection->addCallback("SHOW+TAG+VALUES+FROM+calibs+WHERE+partitionid",
57+
connection->addCallback("SHOW+TAG+VALUES+FROM+calibs+WITH+KEY",
5858
[](http::request<http::dynamic_body>& request, http::response<http::dynamic_body>& response) {
59-
std::string jsonPrefix = R"({"results": [{"statement_id": 0, "series": [{"name": "odc_calibs", "columns": ["key", "value"], "values": [)";
59+
std::string jsonPrefix = R"({"results": [{"statement_id": 0, "series": [{"name": "odc_calibs", "columns": ["value"], "values": [)";
6060
std::string jsonSuffix = R"(]}]}]})";
6161
response.set(http::field::content_type, "application/json");
6262
std::string calibJson;
6363
std::string id = std::string(request.target().substr(request.target().find("WHERE+partitionid+%3D+") + 22));
6464
const std::lock_guard<std::mutex> lock(gMapAccess);
6565
if (gStats.find(id) != gStats.end()) {
6666
for (auto const& calib : gStats.at(id).TasksPerCalib) {
67-
calibJson += "[\"calib\", \"" + calib.first + "\"],";
67+
calibJson += "[\"" + calib.first + "\"],";
6868
}
6969
}
7070
if (!calibJson.empty()) {

0 commit comments

Comments
 (0)