Skip to content
Snippets Groups Projects
Commit 7c3a3f79 authored by Roman Proskuryakov's avatar Roman Proskuryakov Committed by GitHub
Browse files

Add a readme about feature metered for sp-utils (#8736)

parent 68a740c0
Branches
No related merge requests found
Utilities Primitives for Substrate
License: Apache-2.0
\ No newline at end of file
## Features
### metered
This feature changes the behaviour of the function `mpsc::tracing_unbounded`.
With the disabled feature this function is an alias to `futures::channel::mpsc::unbounded`.
However, when the feature is enabled it creates wrapper types to `UnboundedSender<T>`
and `UnboundedReceiver<T>` to register every `send`/`received`/`dropped` action happened on
the channel.
Also this feature creates and registers a prometheus vector with name `unbounded_channel_len` and labels:
| Label | Description |
| ------------ | --------------------------------------------- |
| entity | Name of channel passed to `tracing_unbounded` |
| action | One of `send`/`received`/`dropped` |
License: Apache-2.0
......@@ -16,6 +16,23 @@
// limitations under the License.
//! Utilities Primitives for Substrate
//!
//! # Features
//!
//! ## metered
//!
//! This feature changes the behaviour of the function `mpsc::tracing_unbounded`.
//! With the disabled feature this function is an alias to `futures::channel::mpsc::unbounded`.
//! However, when the feature is enabled it creates wrapper types to `UnboundedSender<T>`
//! and `UnboundedReceiver<T>` to register every `send`/`received`/`dropped` action happened on
//! the channel.
//!
//! Also this feature creates and registers a prometheus vector with name `unbounded_channel_len` and labels:
//!
//! | Label | Description |
//! | ------------ | --------------------------------------------- |
//! | entity | Name of channel passed to `tracing_unbounded` |
//! | action | One of `send`/`received`/`dropped` |
pub mod metrics;
pub mod mpsc;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment