Compute statistics about a range of messages in a given topic and partition.
HTTP request
POST https://{endpoint}/v1/topicStats/{topic=projects/*/locations/*/topics/*}:computeMessageStats
Where {endpoint}
is one of the supported service endpoints.
The URLs use gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
topic |
Required. The topic for which we should compute message stats. Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "partition": string, "startCursor": { object ( |
Fields | |
---|---|
partition |
Required. The partition for which we should compute message stats. |
startCursor |
The inclusive start of the range. |
endCursor |
The exclusive end of the range. The range is empty if endCursor <= startCursor. Specifying a startCursor before the first message and an endCursor after the last message will retrieve all messages. |
Response body
If successful, the response body contains data with the following structure:
Response containing stats for messages in the requested topic and partition.
JSON representation |
---|
{ "messageCount": string, "messageBytes": string, "minimumPublishTime": string, "minimumEventTime": string } |
Fields | |
---|---|
messageCount |
The count of messages. |
messageBytes |
The number of quota bytes accounted to these messages. |
minimumPublishTime |
The minimum publish timestamp across these messages. Note that publish timestamps within a partition are not guaranteed to be non-decreasing. The timestamp will be unset if there are no messages. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
minimumEventTime |
The minimum event timestamp across these messages. For the purposes of this computation, if a message does not have an event time, we use the publish time. The timestamp will be unset if there are no messages. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.