Skip to content

Commit a4fb509

Browse files
committed
wip
1 parent 14d00f8 commit a4fb509

File tree

7 files changed

+176
-135
lines changed

7 files changed

+176
-135
lines changed

Cargo.lock

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rproxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rproxy"
3-
version = "0.0.8"
3+
version = "0.0.9"
44
edition = "2024"
55
default-run = "rproxy"
66

crates/rproxy/src/server/metrics.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pub(crate) struct Metrics {
3434
pub(crate) client_connections_closed_count: Family<LabelsProxy, Counter>,
3535
pub(crate) client_info: Family<LabelsProxyClientInfo, Counter>,
3636

37+
pub(crate) http_in_flight_requests_backend: Family<LabelsProxy, Gauge>,
38+
pub(crate) http_in_flight_requests_client: Family<LabelsProxy, Gauge>,
39+
3740
pub(crate) http_latency_backend: Family<LabelsProxyHttpJrpc, Candlestick>,
3841
pub(crate) http_latency_delta: Family<LabelsProxyHttpJrpc, Candlestick>,
3942
pub(crate) http_latency_total: Family<LabelsProxyHttpJrpc, Candlestick>,
@@ -75,6 +78,9 @@ impl Metrics {
7578

7679
client_info: Family::default(),
7780

81+
http_in_flight_requests_backend: Family::default(),
82+
http_in_flight_requests_client: Family::default(),
83+
7884
http_latency_backend: Family::default(),
7985
http_latency_delta: Family::default(),
8086
http_latency_total: Family::default(),
@@ -128,6 +134,18 @@ impl Metrics {
128134
this.client_connections_closed_count.clone(),
129135
);
130136

137+
this.registry.register(
138+
"http_in_flight_requests_backend",
139+
"count of in-flight backend requests",
140+
this.http_in_flight_requests_backend.clone(),
141+
);
142+
143+
this.registry.register(
144+
"http_in_flight_requests_client",
145+
"count of in-flight client requests",
146+
this.http_in_flight_requests_client.clone(),
147+
);
148+
131149
this.registry.register_with_unit(
132150
"http_latency_backend",
133151
"latency of backend http responses (interval b/w end of client's request and begin of backend's response)",

crates/rproxy/src/server/proxy/config/tls.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl ConfigTls {
7676
});
7777
} else {
7878
if let Ok(decoded) =
79-
base64::engine::general_purpose::STANDARD.decode(&raw)
79+
base64::engine::general_purpose::STANDARD.decode(raw.trim_ascii())
8080
{
8181
raw = decoded;
8282
}
@@ -133,7 +133,7 @@ impl ConfigTls {
133133
});
134134
} else {
135135
if let Ok(decoded) =
136-
base64::engine::general_purpose::STANDARD.decode(&raw)
136+
base64::engine::general_purpose::STANDARD.decode(raw.trim_ascii())
137137
{
138138
raw = decoded;
139139
}
@@ -194,7 +194,8 @@ impl ConfigTls {
194194
let mut raw = Vec::new();
195195
file.read_to_end(&mut raw).expect(ALREADY_VALIDATED);
196196

197-
if let Ok(decoded) = base64::engine::general_purpose::STANDARD.decode(&raw) {
197+
if let Ok(decoded) = base64::engine::general_purpose::STANDARD.decode(raw.trim_ascii())
198+
{
198199
raw = decoded;
199200
}
200201

@@ -213,7 +214,8 @@ impl ConfigTls {
213214
let mut raw = Vec::new();
214215
file.read_to_end(&mut raw).expect(ALREADY_VALIDATED);
215216

216-
if let Ok(decoded) = base64::engine::general_purpose::STANDARD.decode(&raw) {
217+
if let Ok(decoded) = base64::engine::general_purpose::STANDARD.decode(raw.trim_ascii())
218+
{
217219
raw = decoded;
218220
}
219221

0 commit comments

Comments
 (0)