Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
  • Loading branch information
hanahmily committed Oct 23, 2024
1 parent 4c126a3 commit 6ccba37
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bydbctl/internal/cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func newAnalyzeCmd() *cobra.Command {
if subject != "" {
fmt.Printf("%s, %d\n", subject, count)
}
fmt.Printf("total: %d\n", total)
fmt.Printf("total, %d\n", total)
return nil
},
}
Expand Down
48 changes: 45 additions & 3 deletions docs/interacting/bydbctl/analyze.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,52 @@ Arguments:

* `path`: The path of the series index. It's mandatory.

Example:
### All series distribution in the series index

```shell
bydbctl analyze series -s endpoint_sla_day_topn /tmp/measure/measure-default/seg-xxxxxx/sidx
bydbctl analyze series /tmp/measure/measure-default/seg-xxxxxx/sidx
```

This command will analyze the series `endpoint_sla_day_topn` in the series index `/tmp/measure/measure-default/seg-xxxxxx/sidx`.
The expected result is a csv file with the following content:

```csv
browser_app_page_ajax_error_sum_day, 1
browser_app_page_ajax_error_sum_hour, 1
browser_app_page_dns_avg_day_topn, 1644
....
service_sidecar_internal_resp_latency_nanos_hour, 10
service_sla_day, 7
service_sla_hour, 10
service_traffic_minute, 48
tag_autocomplete_minute, 8
zipkin_service_span_traffic_minute, 31
zipkin_service_traffic_minute, 4
total, 1266040
```

The first column is the series name, and the second column is the cardinality of the series.

The `total` line shows the total number of series in the series index.

### A specific series detail in the series index

```shell
bydbctl analyze series -s endpoint_sla_day /tmp/measure/measure-default/seg-xxxxxx/sidx
```

The expected result is a csv file with the following content:

```csv
...
"bWVzaC1zdnI6OnJhdGluZy5zYW1wbGUtc2VydmljZXM=.1_R0VUOi9zb25ncy8zNi9yZXZpZXdzLzM3",
"bWVzaC1zdnI6OnJhdGluZy5zYW1wbGUtc2VydmljZXM=.1_R0VUOi9zb25ncy8zNy9yZXZpZXdzLzM4",
"bWVzaC1zdnI6OnJhdGluZy5zYW1wbGUtc2VydmljZXM=.1_R0VUOi9zb25ncy8zOC9yZXZpZXdzLzM5",
"bWVzaC1zdnI6OnJhdGluZy5zYW1wbGUtc2VydmljZXM=.1_R0VUOi9zb25ncy8zOS9yZXZpZXdzLzQw",
"bWVzaC1zdnI6OnJlY29tbWVuZGF0aW9uLnNhbXBsZS1zZXJ2aWNlcw==.1_R0VUOi9yY21k",
"bWVzaC1zdnI6OnNvbmdzLnNhbXBsZS1zZXJ2aWNlcw==.1_R0VUOi9zb25ncy90b3A=",
...
```

Each row represents a group of tags which compose a series. They are defined in the `entity` field on `Stream` or `Measure`.

In this example, `endpoint_sla_day`'s `entity` is `entity_id` tag which comes from OAP's internal `endpoint_id`.

0 comments on commit 6ccba37

Please sign in to comment.