# Pub/Sub Lite API . topicStats . projects . locations . topics

## Instance Methods

Close httplib2 connections.

Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less than or equal to all messages which have not yet been acknowledged as published, and greater than the offset of any message whose publish has already been acknowledged. It is zero if there have never been messages in the partition.

Compute statistics about a range of messages in a given topic and partition.

Compute the corresponding cursor for a publish or event time in a topic partition.

### Method Details

`close()`

    Close httplib2 connections.

`computeHeadCursor(topic, body=None, x__xgafv=None)`

    Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less than or equal to all messages which have not yet been acknowledged as published, and greater than the offset of any message whose publish has already been acknowledged. It is zero if there have never been messages in the partition.

    Args:
      topic: string, Required. The topic for which we should compute the head cursor. (required)
      body: object, The request body.
        The object takes the form of:

    { # Compute the current head cursor for a partition.
      "partition": "A String", # Required. The partition for which we should compute the head cursor.
    }

      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response containing the head cursor for the requested topic and partition.
      "headCursor": { # A cursor that describes the position of a message within a topic partition. # The head cursor.
        "offset": "A String", # The offset of a message within a topic partition. Must be greater than or equal 0.
      },
    }

`computeMessageStats(topic, body=None, x__xgafv=None)`

    Compute statistics about a range of messages in a given topic and partition.

    Args:
      topic: string, Required. The topic for which we should compute message stats. (required)
      body: object, The request body.
        The object takes the form of:

    { # Compute statistics about a range of messages in a given topic and partition.
      "endCursor": { # A cursor that describes the position of a message within a topic partition. # The exclusive end of the range. The range is empty if end_cursor <= start_cursor. Specifying a start_cursor before the first message and an end_cursor after the last message will retrieve all messages.
        "offset": "A String", # The offset of a message within a topic partition. Must be greater than or equal 0.
      },
      "partition": "A String", # Required. The partition for which we should compute message stats.
      "startCursor": { # A cursor that describes the position of a message within a topic partition. # The inclusive start of the range.
        "offset": "A String", # The offset of a message within a topic partition. Must be greater than or equal 0.
      },
    }

      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response containing stats for messages in the requested topic and partition.
      "messageBytes": "A String", # The number of quota bytes accounted to these messages.
      "messageCount": "A String", # The count of messages.
      "minimumEventTime": "A String", # 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.
      "minimumPublishTime": "A String", # 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.
    }

`computeTimeCursor(topic, body=None, x__xgafv=None)`

    Compute the corresponding cursor for a publish or event time in a topic partition.

    Args:
      topic: string, Required. The topic for which we should compute the cursor. (required)
      body: object, The request body.
        The object takes the form of:

    { # Compute the corresponding cursor for a publish or event time in a topic partition.
      "partition": "A String", # Required. The partition for which we should compute the cursor.
      "target": { # A target publish or event time. Can be used for seeking to or retrieving the corresponding cursor. # Required. The target publish or event time. Specifying a future time will return an unset cursor.
        "eventTime": "A String", # Request the cursor of the first message with event time greater than or equal to `event_time`. If messages are missing an event time, the publish time is used as a fallback. As event times are user supplied, subsequent messages may have event times less than `event_time` and should be filtered by the client, if necessary.
        "publishTime": "A String", # Request the cursor of the first message with publish time greater than or equal to `publish_time`. All messages thereafter are guaranteed to have publish times >= `publish_time`.
      },
    }

      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response containing the cursor corresponding to a publish or event time in a topic partition.
      "cursor": { # A cursor that describes the position of a message within a topic partition. # If present, the cursor references the first message with time greater than or equal to the specified target time. If such a message cannot be found, the cursor will be unset (i.e. `cursor` is not present).
        "offset": "A String", # The offset of a message within a topic partition. Must be greater than or equal 0.
      },
    }