sp-utils => sc-utils (#9677)

* sp-utils => sc-utils

* cargo fmt

* These files are now in the client so should be licensed as GPL3

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Squirrel
2021-09-04 20:20:48 +01:00
committed by GitHub
parent 8c3ad4300a
commit ffced22fb7
51 changed files with 206 additions and 194 deletions
+20
View File
@@ -0,0 +1,20 @@
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` |
License: Apache-2.0