Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huitseeker/tokio-prometheus-metered-channel
A crate integrating tokio bounded channels with Prometheus metrics
https://github.com/huitseeker/tokio-prometheus-metered-channel
channels metrics tokio
Last synced: 5 days ago
JSON representation
A crate integrating tokio bounded channels with Prometheus metrics
- Host: GitHub
- URL: https://github.com/huitseeker/tokio-prometheus-metered-channel
- Owner: huitseeker
- License: apache-2.0
- Created: 2024-11-28T19:53:04.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-31T16:44:12.000Z (7 days ago)
- Last Synced: 2024-12-31T17:28:18.968Z (7 days ago)
- Topics: channels, metrics, tokio
- Language: Rust
- Homepage: https://crates.io/crates/tokio-prometheus-metered-channel
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Tokio Prometheus metered channel
Add the following to your `Cargo.toml`:
```
tokio-prometheus-metered-channel = "0.1.0"
```# Metered Bounded Channel
The metered bounded channel is a specialized threading utility designed to handle communication between threads with an upper limit on capacity while tracking the channel's occupancy through Prometheus metrics.
## Functionality
- **Bounded Capacity**: This channel ensures that no more than a predefined number of messages are held in the channel at any given time.
- **Backpressure Handling**: When the channel reaches its capacity, any additional attempts to send messages will be blocked, allowing for backpressure management until the channel has available space.
- **Prometheus Integration**: The current occupancy of the channel is exposed as a Prometheus metric, enabling real-time monitoring of how "full" the channel is.