Compare commits

...

2 Commits

Author SHA1 Message Date
Conrad Ludgate
7b3fabbe8e docker build tokio_unstable 2024-05-11 11:58:01 +01:00
Conrad Ludgate
2aa74d1aab proxy: add measured-tokio 2024-05-11 11:33:24 +01:00
7 changed files with 27 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
# This is only present for local builds, as it will be overridden
# by the RUSTDOCFLAGS env var in CI.
rustdocflags = ["-Arustdoc::private_intra_doc_links"]
rustflags = ["--cfg=tokio_unstable"]
[alias]
build_testing = ["build", "--features", "testing"]

12
Cargo.lock generated
View File

@@ -3038,6 +3038,17 @@ dependencies = [
"procfs 0.16.0",
]
[[package]]
name = "measured-tokio"
version = "0.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b4ed0773ddbda3a85e39d0e094934549c410ca686a5095bcd72fb62100252a0"
dependencies = [
"itoa",
"measured",
"tokio",
]
[[package]]
name = "memchr"
version = "2.6.4"
@@ -3079,6 +3090,7 @@ dependencies = [
"libc",
"measured",
"measured-process",
"measured-tokio",
"once_cell",
"procfs 0.14.2",
"prometheus",

View File

@@ -109,6 +109,7 @@ leaky-bucket = "1.0.1"
libc = "0.2"
md5 = "0.7.0"
measured = { version = "0.0.21", features=["lasso"] }
measured-tokio = { version = "0.0.21" }
measured-process = { version = "0.0.21" }
memoffset = "0.8"
native-tls = "0.2"

View File

@@ -47,7 +47,7 @@ COPY --chown=nonroot . .
# Show build caching stats to check if it was used in the end.
# Has to be the part of the same RUN since cachepot daemon is killed in the end of this RUN, losing the compilation stats.
RUN set -e \
&& RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,--no-rosegment" cargo build \
&& RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,--no-rosegment --cfg=tokio_unstable" cargo build \
--bin pg_sni_router \
--bin pageserver \
--bin pagectl \

View File

@@ -18,6 +18,9 @@ workspace_hack.workspace = true
procfs.workspace = true
measured-process.workspace = true
[target.'cfg(tokio_unstable)'.dependencies]
measured-tokio.workspace = true
[dev-dependencies]
rand = "0.8"
rand_distr = "0.4.3"

View File

@@ -148,6 +148,11 @@ pub struct NeonMetrics {
#[metric(init = measured_process::ProcessCollector::for_self())]
process: measured_process::ProcessCollector,
#[cfg(tokio_unstable)]
#[metric(namespace = "tokio")]
#[metric(init = measured_tokio::NamedRuntimesCollector::new())]
pub tokio: measured_tokio::NamedRuntimesCollector,
#[metric(namespace = "libmetrics")]
#[metric(init = LibMetrics::new(build_info))]
libmetrics: LibMetrics,

View File

@@ -268,6 +268,10 @@ async fn main() -> anyhow::Result<()> {
build_tag: BUILD_TAG,
});
// add the current runtime to the collector
#[cfg(tokio_unstable)]
neon_metrics.tokio.add_current("proxy");
let jemalloc = match proxy::jemalloc::MetricRecorder::new() {
Ok(t) => Some(t),
Err(e) => {