Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • Машинное обучение
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Истории успеха
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Документация
  • Блог
Проект Яндекса
© 2025 ООО «Яндекс.Облако»
Yandex Managed Service for PostgreSQL
  • Начало работы
  • Управление доступом
  • Правила тарификации
  • Справочник Terraform
    • Аутентификация в API
      • Overview
        • Overview
        • ListRawSessionStates
        • ListRawStatements
  • Метрики Monitoring
  • Аудитные логи Audit Trails
  • Публичные материалы
  • История изменений
  • Обучающие курсы

В этой статье:

  • gRPC request
  • ListRawSessionStatesRequest
  • ListRawSessionStatesResponse
  • SessionState
  1. Справочник API
  2. gRPC (англ.)
  3. PerformanceDiagnostics
  4. ListRawSessionStates

Managed Service for PostgreSQL API, gRPC: PerformanceDiagnosticsService.ListRawSessionStates

Статья создана
Yandex Cloud
Обновлена 26 ноября 2024 г.
  • gRPC request
  • ListRawSessionStatesRequest
  • ListRawSessionStatesResponse
  • SessionState

Retrieves raw statistics on sessions. Corresponds to the pg_stat_activity view.

gRPC requestgRPC request

rpc ListRawSessionStates (ListRawSessionStatesRequest) returns (ListRawSessionStatesResponse)

ListRawSessionStatesRequestListRawSessionStatesRequest

{
  "cluster_id": "string",
  "from_time": "google.protobuf.Timestamp",
  "to_time": "google.protobuf.Timestamp",
  "page_size": "int64",
  "page_token": "string"
}

Field

Description

cluster_id

string

Required field. ID of a PostgreSQL cluster to request session statistics for.

To get a PostgreSQL cluster ID, use the ClusterService.List request.

from_time

google.protobuf.Timestamp

Beginning of the period for which you need to request data (in the RFC3339 text format).

to_time

google.protobuf.Timestamp

End of the period for which you need to request data (in the RFC3339 text format).

page_size

int64

The maximum number of results per page to return. If the number of the results is larger than page_size, the service returns ListRawSessionStatesResponse.next_page_token. You can use it to get the next page of the results in subsequent requests.

page_token

string

Page token. To get the next page of results, set page_token to the ListRawSessionStatesResponse.next_page_token returned by the previous PostgreSQL session list request.

ListRawSessionStatesResponseListRawSessionStatesResponse

{
  "session_states": [
    {
      "time": "google.protobuf.Timestamp",
      "host": "string",
      "pid": "int64",
      "database": "string",
      "user": "string",
      "application_name": "string",
      "backend_start": "google.protobuf.Timestamp",
      "xact_start": "google.protobuf.Timestamp",
      "query_start": "google.protobuf.Timestamp",
      "state_change": "google.protobuf.Timestamp",
      "wait_event_type": "string",
      "wait_event": "string",
      "state": "string",
      "query": "string",
      "backend_type": "string",
      "client_addr": "string",
      "client_hostname": "string",
      "client_port": "int64",
      "backend_xid": "int64",
      "backend_xmin": "int64",
      "blocking_pids": "string",
      "query_id": "string"
    }
  ],
  "next_page_token": "string"
}

Field

Description

session_states[]

SessionState

List of PostgreSQL sessions.

next_page_token

string

This token allows you to get the next page of results when requesting the PostgreSQL session list. If the number of the results is larger than ListRawSessionStatesRequest.page_size, use the next_page_token as the value for the ListRawSessionStatesRequest.page_token parameter in the next request. Each subsequent request will have its own next_page_token to continue paging through the results.

SessionStateSessionState

Field

Description

time

google.protobuf.Timestamp

Time of collecting statistics on sessions (in the RFC3339 text format).

host

string

Host of the connected client.

pid

int64

Server process ID. For client connections, this is a client connection ID.

database

string

Database ID.

user

string

User ID.

application_name

string

Application name on the connected client.

backend_start

google.protobuf.Timestamp

Time when a given process was started. For client connections, this is the time when the client connected to the server.

xact_start

google.protobuf.Timestamp

Time when a transaction of a given process was started. Returns [NULL] if no transaction is active.

If the currently active query is the first of its transaction, the value of this parameter is equal to the value of the query_start parameter.

query_start

google.protobuf.Timestamp

Time when the currently active query was started.

If the state parameter does not take the value [active], the parameter returns the time when the lastest query was started.

state_change

google.protobuf.Timestamp

Time when the state parameter was last changed.

wait_event_type

string

Type of event for which the backend is waiting. Such an event is called a wait event. A backend refers to the process that maintains the client connection.

For the list of wait events, see the PostgreSQL documentation. If the backend is not waiting for any event, the parameter returns [NULL].

wait_event

string

Wait event name.

For the list of such names, see the PostgreSQL documentation. If the backend is not waiting for any event, the parameter returns [NULL].

state

string

Current backend state. For the list of possible values, see the PostgreSQL documentation.

query

string

Text of the most recent query.

If the state parameter takes the value [active], the parameter shows the currently executing query. For the rest of the states, the parameter shows the last query that was executed. By default, the query text is truncated to 1024 bytes.

backend_type

string

Current backend type. For the list of possible values, see the PostgreSQL documentation.

client_addr

string

IP address of the connected client.

The parameter returns [NULL] in the following cases:

  • The client is connected via a Unix socket on the server.
  • A given process is internal (for example, autovacuum).

client_hostname

string

Host name of the connected client (relevant for IP connections).

client_port

int64

TCP port number that the client is using for communication with the server.

Returns [-1] if the client is connected via a Unix socket on the server. Returns [NULL] if a given process is internal (for example, autovacuum).

backend_xid

int64

Top-level transaction ID, if any.

backend_xmin

int64

Current [xmin horizon].

blocking_pids

string

Process IDs that are blocking a given server process ID.

query_id

string

Query ID.

Была ли статья полезна?

Предыдущая
Overview
Следующая
ListRawStatements
Проект Яндекса
© 2025 ООО «Яндекс.Облако»