1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
use diem_metrics::{register_int_counter_vec, IntCounterVec};
use once_cell::sync::Lazy;
pub enum RpcResult {
Success,
Error,
}
impl RpcResult {
pub fn as_str(&self) -> &'static str {
match self {
RpcResult::Success => "success",
RpcResult::Error => "error",
}
}
}
pub static HTTP_WEBSOCKET_REQUESTS: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_http_websocket_requests_count",
"Cumulative number of http requests that the JSON RPC streaming service receives",
&[
"sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static HTTP_WEBSOCKET_REQUEST_UPGRADES: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_http_websocket_upgrades_count",
"Cumulative number of http websocket requests which successfully get upgraded that the JSON RPC streaming service receives",
&[
"sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static MESSAGES_RECEIVED: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_messages_received",
"Cumulative number of messages that the Streaming RPC service receives",
&[
"transport", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static MESSAGES_SENT: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_messages_sent",
"Cumulative number of messages that the Streaming RPC service sends",
&[
"transport", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static SUBSCRIPTION_RPC_RECEIVED: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_subscription_rpc_received",
"Cumulative number of RPC messages that the Streaming RPC service receives, parses successfully, and responds to",
&[
"transport", "method", "result", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static SUBSCRIPTION_RPC_SENT: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_subscription_rpc_sent",
"Cumulative number of RPC messages that the Streaming RPC service sends as part of subscriptions",
&[
"transport", "method", "result", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static SUBSCRIPTION_OKS: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_subscription_oks",
"Cumulative number of 'OK' messages sent in response to starting a subscription",
&[
"transport", "method", "result", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static CLIENT_CONNECTED: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_clients_count",
"Cumulative number of connected clients",
&[
"transport", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});
pub static INVALID_REQUESTS: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"diem_streaming_rpc_invalid_requests_count",
"Cumulative number of invalid requests that JSON RPC client service receives",
&[
"transport", "method", "errortype", "sdk_lang", "sdk_ver", ]
)
.unwrap()
});