Skip to content

Commit

Permalink
[fix][doc] miss stats-internal for non-partition topic and wrong API …
Browse files Browse the repository at this point in the history
…for paritioned topic stats-internal (#19044)

Signed-off-by: ericsyh <ericshenyuhao@outlook.com>
  • Loading branch information
ericsyh authored Dec 26, 2022
1 parent 63bf0ab commit 67bd947
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 28 deletions.
82 changes: 76 additions & 6 deletions site2/docs/admin-api-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,77 @@ The following is an example. For the description of topic stats, see [Pulsar sta
}
```

### Internal stats

You can check the detailed statistics of a topic. The following is an example. For the description of each internal topic stats, see [Pulsar statistics](administration-stats.md#topic-internal-stats).

```json
{
"entriesAddedCounter": 20449518,
"numberOfEntries": 3233,
"totalSize": 331482,
"currentLedgerEntries": 3233,
"currentLedgerSize": 331482,
"lastLedgerCreatedTimestamp": "2016-06-29 03:00:23.825",
"lastLedgerCreationFailureTimestamp": null,
"waitingCursorsCount": 1,
"pendingAddEntriesCount": 0,
"lastConfirmedEntry": "324711539:3232",
"state": "LedgerOpened",
"ledgers": [
{
"ledgerId": 324711539,
"entries": 0,
"size": 0
}
],
"cursors": {
"my-subscription": {
"markDeletePosition": "324711539:3133",
"readPosition": "324711539:3233",
"waitingReadOp": true,
"pendingReadOps": 0,
"messagesConsumedCounter": 20449501,
"cursorLedger": 324702104,
"cursorLedgerLastEntry": 21,
"individuallyDeletedMessages": "[(324711539:3134‥324711539:3136], (324711539:3137‥324711539:3140], ]",
"lastLedgerSwitchTimestamp": "2016-06-29 01:30:19.313",
"state": "Open"
}
}
}
```

You can get the internal stats for the partitioned topic in the following ways.

````mdx-code-block
<Tabs groupId="api-choice"
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">
```shell
pulsar-admin topics stats-internal \
persistent://test-tenant/namespace/topic
```
</TabItem>
<TabItem value="REST API">
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/internalStats|operation/getInternalStats?version=@pulsar:version_number@}
</TabItem>
<TabItem value="Java">
```java
admin.topics().getInternalStats(topic);
```
</TabItem>
</Tabs>
````

## Manage partitioned topics
You can use Pulsar [admin API](admin-api-overview.md) to create, update, delete and check the status of partitioned topics.

Expand Down Expand Up @@ -1711,7 +1782,6 @@ admin.topics().getPartitionedTopicList(namespace);

### Stats


You can check the current statistics of a given partitioned topic and its connected producers and consumers in the following ways.

````mdx-code-block
Expand Down Expand Up @@ -1802,7 +1872,7 @@ Note that in the subscription JSON object, `chuckedMessageRate` is deprecated. P

### Internal stats

You can check the detailed statistics of a topic. The following is an example. For the description of each internal topic stats, see [Pulsar statistics](administration-stats.md#topic-internal-stats).
You can check the detailed statistics of a partitioned topic. The following is an example. For the description of each internal topic stats, see [Pulsar statistics](administration-stats.md#topic-internal-stats).

```json
{
Expand Down Expand Up @@ -1850,20 +1920,20 @@ You can get the internal stats for the partitioned topic in the following ways.
<TabItem value="pulsar-admin">
```shell
pulsar-admin topics stats-internal \
persistent://test-tenant/namespace/topic
pulsar-admin topics partitioned-stats-internal \
persistent://test-tenant/namespace/topic
```
</TabItem>
<TabItem value="REST API">
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/internalStats|operation/getInternalStats?version=@pulsar:version_number@}
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/partitioned-internalStats|operation/getPartitionedInternalStats?version=@pulsar:version_number@}
</TabItem>
<TabItem value="Java">
```java
admin.topics().getInternalStats(topic);
admin.topics().getPartitionedInternalStats(topic);
```
</TabItem>
Expand Down
83 changes: 75 additions & 8 deletions site2/website/versioned_docs/version-2.10.x/admin-api-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,77 @@ admin.topics().getStats(topic, false /* is precise backlog */);
</Tabs>
````

### Internal stats

You can check the detailed statistics of a topic. The following is an example. For the description of each internal topic stats, see [Pulsar statistics](administration-stats.md#topic-internal-stats).

```json
{
"entriesAddedCounter": 20449518,
"numberOfEntries": 3233,
"totalSize": 331482,
"currentLedgerEntries": 3233,
"currentLedgerSize": 331482,
"lastLedgerCreatedTimestamp": "2016-06-29 03:00:23.825",
"lastLedgerCreationFailureTimestamp": null,
"waitingCursorsCount": 1,
"pendingAddEntriesCount": 0,
"lastConfirmedEntry": "324711539:3232",
"state": "LedgerOpened",
"ledgers": [
{
"ledgerId": 324711539,
"entries": 0,
"size": 0
}
],
"cursors": {
"my-subscription": {
"markDeletePosition": "324711539:3133",
"readPosition": "324711539:3233",
"waitingReadOp": true,
"pendingReadOps": 0,
"messagesConsumedCounter": 20449501,
"cursorLedger": 324702104,
"cursorLedgerLastEntry": 21,
"individuallyDeletedMessages": "[(324711539:3134‥324711539:3136], (324711539:3137‥324711539:3140], ]",
"lastLedgerSwitchTimestamp": "2016-06-29 01:30:19.313",
"state": "Open"
}
}
}
```

You can get the internal stats for the partitioned topic in the following ways.

````mdx-code-block
<Tabs groupId="api-choice"
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">
```shell
$ pulsar-admin topics stats-internal \
persistent://test-tenant/namespace/topic
```
</TabItem>
<TabItem value="REST API">
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/internalStats|operation/getInternalStats?version=@pulsar:version_number@}
</TabItem>
<TabItem value="Java">
```java
admin.topics().getInternalStats(topic);
```
</TabItem>
</Tabs>
````

## Manage partitioned topics
You can use Pulsar [admin API](admin-api-overview.md) to create, update, delete and check status of partitioned topics.

Expand Down Expand Up @@ -2179,7 +2250,7 @@ admin.topics().getPartitionedStats(topic, true /* per partition */, false /* is

### Internal stats

You can check the detailed statistics of a topic. The following is an example. For description of each stats, refer to [get internal stats](#get-internal-stats).
You can check the detailed statistics of a partitioned topic. The following is an example. For description of each stats, refer to [get internal stats](#get-internal-stats).

```json

Expand Down Expand Up @@ -2229,24 +2300,20 @@ You can get the internal stats for the partitioned topic in the following ways.
<TabItem value="pulsar-admin">
```shell
$ pulsar-admin topics stats-internal \
$ pulsar-admin topics partitioned-stats-internal \
persistent://test-tenant/namespace/topic
```
</TabItem>
<TabItem value="REST API">
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/internalStats|operation/getInternalStats?version=@pulsar:version_number@}
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/partitioned-internalStats|operation/getPartitionedInternalStats?version=@pulsar:version_number@}
</TabItem>
<TabItem value="Java">
```java
admin.topics().getInternalStats(topic);
admin.topics().getPartitionedInternalStats(topic);
```
</TabItem>
Expand Down
81 changes: 75 additions & 6 deletions site2/website/versioned_docs/version-2.8.x/admin-api-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,77 @@ admin.topics().getStats(topic, false /* is precise backlog */);
</Tabs>
````

### Internal stats

You can check the detailed statistics of a topic. The following is an example. For the description of each internal topic stats, see [Pulsar statistics](administration-stats.md#topic-internal-stats).

```json
{
"entriesAddedCounter": 20449518,
"numberOfEntries": 3233,
"totalSize": 331482,
"currentLedgerEntries": 3233,
"currentLedgerSize": 331482,
"lastLedgerCreatedTimestamp": "2016-06-29 03:00:23.825",
"lastLedgerCreationFailureTimestamp": null,
"waitingCursorsCount": 1,
"pendingAddEntriesCount": 0,
"lastConfirmedEntry": "324711539:3232",
"state": "LedgerOpened",
"ledgers": [
{
"ledgerId": 324711539,
"entries": 0,
"size": 0
}
],
"cursors": {
"my-subscription": {
"markDeletePosition": "324711539:3133",
"readPosition": "324711539:3233",
"waitingReadOp": true,
"pendingReadOps": 0,
"messagesConsumedCounter": 20449501,
"cursorLedger": 324702104,
"cursorLedgerLastEntry": 21,
"individuallyDeletedMessages": "[(324711539:3134‥324711539:3136], (324711539:3137‥324711539:3140], ]",
"lastLedgerSwitchTimestamp": "2016-06-29 01:30:19.313",
"state": "Open"
}
}
}
```

You can get the internal stats for the partitioned topic in the following ways.

````mdx-code-block
<Tabs groupId="api-choice"
defaultValue="pulsar-admin"
values={[{"label":"pulsar-admin","value":"pulsar-admin"},{"label":"REST API","value":"REST API"},{"label":"Java","value":"Java"}]}>
<TabItem value="pulsar-admin">
```shell
$ pulsar-admin topics stats-internal \
persistent://test-tenant/namespace/topic
```
</TabItem>
<TabItem value="REST API">
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/internalStats|operation/getInternalStats?version=@pulsar:version_number@}
</TabItem>
<TabItem value="Java">
```java
admin.topics().getInternalStats(topic);
```
</TabItem>
</Tabs>
````

## Manage partitioned topics
You can use Pulsar [admin API](admin-api-overview.md) to create, update, delete and check status of partitioned topics.

Expand Down Expand Up @@ -1896,7 +1967,7 @@ admin.topics().getPartitionedStats(topic, true /* per partition */, false /* is

### Internal stats

You can check the detailed statistics of a topic. The following is an example. For description of each stats, refer to [get internal stats](#get-internal-stats).
You can check the detailed statistics of a partitioned topic. The following is an example. For description of each stats, refer to [get internal stats](#get-internal-stats).

```json

Expand Down Expand Up @@ -1946,23 +2017,21 @@ You can get the internal stats for the partitioned topic in the following ways.
<TabItem value="pulsar-admin">
```shell
$ pulsar-admin topics stats-internal \
$ pulsar-admin topics partitioned-stats-internal \
persistent://test-tenant/namespace/topic
```
</TabItem>
<TabItem value="REST API">
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/internalStats|operation/getInternalStats?version=@pulsar:version_number@}
{@inject: endpoint|GET|/admin/v2/:schema/:tenant/:namespace/:topic/partitioned-internalStats|operation/getPartitionedInternalStats?version=@pulsar:version_number@}
</TabItem>
<TabItem value="Java">
```java
admin.topics().getInternalStats(topic);
admin.topics().getPartitionedInternalStats(topic);
```
Expand Down
Loading

0 comments on commit 67bd947

Please sign in to comment.