sc_utils/lib.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19//! Utilities Primitives for Substrate
20//!
21//! This crate provides `mpsc::tracing_unbounded` function that returns wrapper types to
22//! `async_channel::Sender<T>` and `async_channel::Receiver<T>`, which register every
23//! `send`/`received`/`dropped` action happened on the channel.
24//!
25//! Also this wrapper creates and registers a prometheus vector with name `unbounded_channel_len`
26//! and labels:
27//!
28//! | Label | Description |
29//! | ------------ | --------------------------------------------- |
30//! | entity | Name of channel passed to `tracing_unbounded` |
31//! | action | One of `send`/`received`/`dropped` |
32
33pub mod id_sequence;
34pub mod metrics;
35pub mod mpsc;
36pub mod notification;
37pub mod pubsub;
38pub mod status_sinks;