Tool: get_advanced_aggregated_wait_event_stats
Fetches aggregated wait event statistics to identify performance bottlenecks for a requested AlloyDB instance within a specified time period. Supports filtering by database name, database user, and a specific query ID, selecting the aggregation level (by wait class or granular wait event), as well as pagination. Returns statistics including wait class or event name, total time spent (sum(time_spent)), average time spent (avg(time_spent)), and total wait count (sum(count)). Requires advanced query insights to be enabled.
The following sample demonstrate how to use curl to invoke the get_advanced_aggregated_wait_event_stats MCP tool.
| Curl Request |
|---|
curl --location 'https://LOCATION-databaseinsights.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_advanced_aggregated_wait_event_stats", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Replace LOCATION with the location of your AlloyDB instance (for example, if your instance is in us-east7, use https://us-east7-databaseinsights.googleapis.com/mcp).
Input Schema
Message for fetching wait event statistics (including wait class or event, time spent, and count) for the requested instance.
FetchWaitEventStatsRequest
| JSON representation |
|---|
{
"parent": string,
"fullResourceName": string,
"startTime": string,
"endTime": string,
"database": string,
"username": string,
"queryId": string,
"pageSize": integer,
"pageToken": string,
"view": enum ( |
| Fields | |
|---|---|
parent |
Required. The name of the location where we request stats. Format: |
fullResourceName |
Required. Identifies the AlloyDB instance. |
startTime |
Optional. The beginning of the interval for fetching stats in RFC3339 format. |
endTime |
Optional. The end of the interval for fetching stats in RFC3339 format. |
database |
Optional. Filters results to a specific database name. |
username |
Optional. Filters results to a specific database user. |
queryId |
Optional. Fetches wait event stats broken down for a single, specific query ID. |
pageSize |
Optional. The maximum number of stats to return. |
pageToken |
Optional. Token for fetching the next set of results. |
view |
Optional. The view used to group the wait event results. Defaults to WAIT_CLASS. |
WaitEventView
Defines the aggregation level for wait statistics.
| Enums | |
|---|---|
WAIT_EVENT_VIEW_UNSPECIFIED |
The view is not specified. |
WAIT_CLASS |
Default: Aggregates by wait class (e.g., IO, Lock, CPU). |
WAIT_EVENT |
Granular: Aggregates by specific wait event (e.g., DataFileRead, ClientWrite). |
Output Schema
Response message containing wait event statistics, including wait class or event, sum and average of time spent, and wait count.
FetchWaitEventStatsResponse
| JSON representation |
|---|
{
"results": [
array
],
"metadata": {
object ( |
| Fields | |
|---|---|
results[] |
Rows of data returned based on the user query. |
metadata |
List of all the fields the client has interactions for. |
nextPageToken |
Support for pagination. |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a JSON |
numberValue |
Represents a JSON number. Must not be |
stringValue |
Represents a JSON string. |
boolValue |
Represents a JSON boolean ( |
structValue |
Represents a JSON object. |
listValue |
Represents a JSON array. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
ResultSetMetadata
| JSON representation |
|---|
{
"fields": [
{
object ( |
| Fields | |
|---|---|
fields[] |
Information on all columns of the result row. |
Field
| JSON representation |
|---|
{
"name": string,
"type": enum ( |
| Fields | |
|---|---|
name |
Field name according to the public schema. |
type |
Field type defined according to the public schema or depends on the aggregation method in case of an aggregation field. |
description |
Description of the value the field holds. |
NullValue
Represents a JSON null.
NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.
A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.
| Enums | |
|---|---|
NULL_VALUE |
Null value. |
FieldType
Type of field, which will define how to read a particular key.
| Enums | |
|---|---|
FIELD_TYPE_UNSPECIFIED |
Field type is unknown. |
INT64 |
Int64 field type. |
UINT64 |
Unsigned int64 field type. |
INT32 |
Int32 field type. |
UINT32 |
Unsigned int64 field type. |
STRING |
String field type. |
DOUBLE |
Double based data type. |
ARRAY |
Trace info type. |
BOOL |
Boolean field type. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌