| 2474 | } |
| 2475 | |
| 2476 | static void handle_atlas_impact_analysis(cbm_http_conn_t *c, const cbm_http_req_t *req) { |
| 2477 | char project[256] = {0}, file[CBM_SZ_2K] = {0}, node[CBM_SZ_2K] = {0}, refresh[8] = {0}; |
| 2478 | cbm_store_t *store = atlas_open_project(c, req, project, sizeof(project)); |
| 2479 | if (!store) |
| 2480 | return; |
| 2481 | cbm_http_query_param(req->query, "file", file, sizeof(file)); |
| 2482 | cbm_http_query_param(req->query, "node", node, sizeof(node)); |
| 2483 | cbm_http_query_param(req->query, "refresh", refresh, sizeof(refresh)); |
| 2484 | int64_t id = node[0] == '#' ? strtoll(node + 1, NULL, 10) : -1; |
| 2485 | char *json = cbm_atlas_impact_analysis_request( |
| 2486 | store, project, file, id, node[0] && node[0] != '#' ? node : NULL, !strcmp(refresh, "1")); |
| 2487 | cbm_store_close(store); |
| 2488 | atlas_reply_json(c, json, 500, "{\"error\":\"impact analysis unavailable\"}"); |
| 2489 | } |
| 2490 | |
| 2491 | /* GET /api/metrics?project=X — the Dashboard payload. */ |
| 2492 | static void handle_atlas_metrics(cbm_http_conn_t *c, const cbm_http_req_t *req) { |
no test coverage detected