Skip to content

feat: Adds statistics measurement for compact-throughput (#26754)#26883

Merged
devanbenz merged 1 commit into1.12from
db/cherrypick-879e34
Oct 6, 2025
Merged

feat: Adds statistics measurement for compact-throughput (#26754)#26883
devanbenz merged 1 commit into1.12from
db/cherrypick-879e34

Conversation

@devanbenz
Copy link
Copy Markdown

This PR adds the following as an available /debug/vars field.

"stats" : { "compact-throughput-usage-percentage" : <percentage used> }

This will show the current compaction throughput usage WRT the available limiter tokens as defined by the golang rate limiter.

https://pkg.go.dev/golang.org/x/time/rate#Limiter.Limit https://pkg.go.dev/golang.org/x/time/rate#Limiter.Tokens

The algorithm for finding our usage is the following

percentage = 100 * (1 - (tokens) / limit)

(cherry picked from commit 879e34a)

This PR adds the following as an available `/debug/vars` field.
```
"stats" : { "compact-throughput-usage-percentage" : <percentage used> }
```

This will show the current compaction throughput usage WRT the available limiter tokens as defined by the golang rate limiter.

https://pkg.go.dev/golang.org/x/time/rate#Limiter.Limit
https://pkg.go.dev/golang.org/x/time/rate#Limiter.Tokens

The algorithm for finding our usage is the following

```
percentage = 100 * (1 - (tokens) / limit)
```

(cherry picked from commit 879e34a)
Copy link
Copy Markdown
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devanbenz devanbenz merged commit 0e656d6 into 1.12 Oct 6, 2025
9 checks passed
@devanbenz devanbenz deleted the db/cherrypick-879e34 branch October 6, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Port to 1.12]: feat: Adds statistics measurement for compact-throughput (#26754)

2 participants