/**
* @file test_tsdb_api-t.cpp
* @brief End-to-end TSDB dashboard + REST API test (regression for #5684).
*
* The TSDB dashboard's JS issues relative-URL fetch() calls:
*
* fetch('/api/tsdb/metrics')
* fetch('/api/tsdb/query?...')
*
* Those URLs only resolve if the dashboard and the API endpoints share
* the same origin (host + port). Issue #5684 reported "Error loading
* metrics" because the dashboard was served from admin-web_port while
* the API lived on admin-restapi_port. This test pins the new wiring:
*
* - Dashboard at http://host:restapi_port/tsdb
* - Chart.bundle.js at http://host:restapi_port/Chart.bundle.js
* - All /api/tsdb/* endpoints at http://host:restapi_port/api/tsdb/*
*
* Each assertion below executes a real HTTP GET against a running
* ProxySQL and inspects the response: status code, content-type, and
* for JSON endpoints the parsed payload shape.
*/
#include
#include