database

Get query statistics (MySQL / PostgreSQL)

Returns a list of query statistics for the Managed Database service by its {uuid} and optional query parameters {limit}, {offset} and {order}. Query statistics will differ depending on the database type.

get/1.3/database/{uuid}/query-statistics

Request

  • Base URL: https://api.upcloud.com
  • URL: https://api.upcloud.com/1.3/database/{uuid}/query-statistics
  • Auth: HTTP bearer

Path parameters

uuidstring uuid required

The unique identifier for the integration.

Example:01234567-89ab-cdef-0123-456789abcdef

Service UUID

Query parameters

limitinteger

Schema for a query parameter specifying the maximum number of entries to return (limit).

Example:10

Number of entries to receive at most.

offsetinteger

Schema for a query parameter specifying the offset for pagination.

Offset for retrieved results.

orderstring

Schema for a query parameter specifying the order.

Example:asc

Sort order

Response

OK

Example response

{
  "mysql": [
    {
      "avg_timer_wait": 12345,
      "count_star": 100,
      "digest": "abc123def456",
      "digest_text": "SELECT * FROM users WHERE id = ?",
      "first_seen": "2024-06-01T12:00:00Z",
      "last_seen": "2024-06-10T15:30:00Z"
    }
  ],
  "pg": [
    {
      "blk_read_time": 0,
      "blk_write_time": 0,
      "calls": 57425,
      "database_name": "defaultdb",
      "local_blks_dirtied": 0,
      "local_blks_hit": 0,
      "local_blks_read": 0,
      "local_blks_written": 0,
      "max_time": 133387,
      "mean_time": 1060,
      "min_time": 151,
      "query": "COMMIT",
      "rows": 0,
      "shared_blks_dirtied": 0,
      "shared_blks_hit": 0,
      "shared_blks_read": 0,
      "shared_blks_written": 0,
      "stddev_time": 0,
      "temp_blks_read": 0,
      "temp_blks_written": 0,
      "total_time": 60879904,
      "user_name": "upadmin"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.