Method: topicStats.projects.locations.topics.computeMessageStats

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

string

Required. The topic for which we should compute message stats.

Authorization requires the following IAM permission on the specified resource topic:

  • pubsublite.topics.computeMessageStats

Request body

The request body contains data with the following structure:

JSON representation
{
  "partition": string,
  "startCursor": {
    object (Cursor)
  },
  "endCursor": {
    object (Cursor)
  }
}
Fields
partition

string (int64 format)

Required. The partition for which we should compute message stats.

startCursor

object (Cursor)

The inclusive start of the range.

endCursor

object (Cursor)

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

string (int64 format)

The count of messages.

messageBytes

string (int64 format)

The number of quota bytes accounted to these messages.

minimumPublishTime

string (Timestamp format)

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: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

minimumEventTime

string (Timestamp format)

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: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.