Skip to main content

tx5_signal_srv/
lib.rs

1#![deny(missing_docs)]
2#![deny(unsafe_code)]
3#![doc = tx5_core::__doc_header!()]
4//! # tx5-signal-srv
5//!
6//! Holochain webrtc signal server.
7
8#![doc = include_str!("docs/srv_help.md")]
9
10/// Re-exported dependencies.
11pub mod deps {
12    pub use tx5_core::deps::*;
13}
14
15use once_cell::sync::Lazy;
16
17static METRICS_REQ_COUNT: Lazy<prometheus::IntCounter> = Lazy::new(|| {
18    prometheus::register_int_counter!(
19        "metrics_req_cnt",
20        "metrics request count"
21    )
22    .unwrap()
23});
24
25static METRICS_REQ_TIME_S: Lazy<prometheus::Histogram> = Lazy::new(|| {
26    prometheus::register_histogram!(
27        "metrics_req_time_s",
28        "metrics request time in seconds"
29    )
30    .unwrap()
31});
32
33static CLIENT_ACTIVE_WS_COUNT: Lazy<prometheus::IntGauge> = Lazy::new(|| {
34    prometheus::register_int_gauge!(
35        "client_active_ws_cnt",
36        "currently active websocket connection count"
37    )
38    .unwrap()
39});
40
41static CLIENT_WS_COUNT: Lazy<prometheus::IntCounter> = Lazy::new(|| {
42    prometheus::register_int_counter!(
43        "client_ws_cnt",
44        "incoming websocket connection count"
45    )
46    .unwrap()
47});
48
49static CLIENT_AUTH_WS_COUNT: Lazy<prometheus::IntCounter> = Lazy::new(|| {
50    prometheus::register_int_counter!(
51        "client_auth_ws_cnt",
52        "incoming websocket connection count that complete authentication"
53    )
54    .unwrap()
55});
56
57static CLIENT_WS_REQ_TIME_S: Lazy<prometheus::Histogram> = Lazy::new(|| {
58    prometheus::register_histogram!(
59        "client_ws_req_time_s",
60        "client websocket request time in seconds"
61    )
62    .unwrap()
63});
64
65static REQ_FWD_CNT: Lazy<prometheus::IntCounter> = Lazy::new(|| {
66    prometheus::register_int_counter!(
67        "req_fwd_cnt",
68        "total count of forward requests processed"
69    )
70    .unwrap()
71});
72
73static REQ_DEMO_CNT: Lazy<prometheus::IntCounter> = Lazy::new(|| {
74    prometheus::register_int_counter!(
75        "req_demo_cnt",
76        "total count of demo broadcast requests processed"
77    )
78    .unwrap()
79});
80
81pub use tx5_core::{Error, ErrorExt, Id, Result};
82
83use clap::Parser;
84
85mod config;
86pub use config::*;
87
88mod server;
89pub use server::*;