public.databases.queries
const url = 'https://rest.watchtower15.com/v1/databases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/queries?sort=total_time&order=asc';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://rest.watchtower15.com/v1/databases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/queries?sort=total_time&order=asc' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.
The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.
The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.
Responses
Section titled “Responses”DatabasesQueriesResource
object
object
Whether the database keeps per-statement data: false for a counts-only database.
counts_only while available is false; null otherwise.
object
Epoch milliseconds.
Epoch milliseconds.
The window’s top 50 statements by the chosen sort.
object
All the other statements: the window’s totals less the rows shown; null for a counts-only database.
object
The window’s totals; null for a counts-only database.
object
Example generated
{ "data": { "available": true, "reason": "example", "window": { "from": 1, "to": 1 }, "statements": [ { "digest_key": "example", "schema_key": "example", "schema_name": "example", "statement_text": "example", "text_truncated": true, "first_seen_at": 1, "last_seen_at": 1, "calls": 1, "total_wait_us": 1, "lock_time_us": 1, "rows_examined": 1, "rows_sent": 1, "rows_affected": 1, "errors": 1, "warnings": 1, "tmp_disk_tables": 1, "tmp_tables": 1, "full_joins": 1, "full_scans": 1, "sort_merge_passes": 1, "no_index_used": 1, "no_good_index_used": 1, "avg_wait_us": 1, "no_index_share": 1, "rows_examined_per_row_sent": 1, "impact_index": 1 } ], "other": { "calls": 1, "total_wait_us": 1, "lock_time_us": 1, "rows_examined": 1, "rows_sent": 1, "rows_affected": 1, "errors": 1, "warnings": 1, "tmp_disk_tables": 1, "tmp_tables": 1, "full_joins": 1, "full_scans": 1, "sort_merge_passes": 1, "no_index_used": 1, "no_good_index_used": 1, "avg_wait_us": 1, "no_index_share": 1, "rows_examined_per_row_sent": 1 }, "totals": { "calls": 1, "total_wait_us": 1, "lock_time_us": 1, "rows_examined": 1, "rows_sent": 1, "rows_affected": 1, "errors": 1, "warnings": 1, "tmp_disk_tables": 1, "tmp_tables": 1, "full_joins": 1, "full_scans": 1, "sort_merge_passes": 1, "no_index_used": 1, "no_good_index_used": 1, "avg_wait_us": 1, "no_index_share": 1, "rows_examined_per_row_sent": 1 } }}The API key is missing, malformed, expired or revoked.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}The key or its owner does not hold what the operation needs.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}No such record in this organisation (an absent id and another organisation’s answer alike).
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}The request is invalid; errors names the parameters.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}A rate limit or the organisation’s daily limit is reached; Retry-After says when to retry.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}An unexpected error.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}A data store did not answer within the request’s 10 seconds; try again shortly (store_unavailable).
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}