Skip to content

Commit

Permalink
build(deps): Bump lgalloc to 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Nov 23, 2024
1 parent 65aae31 commit 4035b31
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion misc/cargo-vet/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ version = "1.3.0"
criteria = "safe-to-deploy"

[[exemptions.lgalloc]]
version = "0.3.1"
version = "0.4.0"
criteria = "safe-to-deploy"

[[exemptions.libc]]
Expand Down
2 changes: 1 addition & 1 deletion src/compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ differential-dataflow = "0.13.1"
differential-dogs3 = "0.1.1"
futures = "0.3.25"
itertools = "0.10.5"
lgalloc = "0.3"
lgalloc = "0.4"
mz-build-info = { path = "../build-info" }
mz-cluster = { path = "../cluster" }
mz-cluster-client = { path = "../cluster-client" }
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
workspace = true

[dependencies]
lgalloc = "0.3"
lgalloc = "0.4"
libc = "0.2.138"
mz-ore = { path = "../ore", features = ["metrics"] }
paste = "1.0"
Expand Down
17 changes: 9 additions & 8 deletions src/metrics/src/lgalloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ macro_rules! metrics_size_class {
) => {
paste! {
struct LgMetrics {
stats: lgalloc::LgAllocStats,
size_class: BTreeMap<usize, LgMetricsSC>,
$($metric: raw::UIntGaugeVec,)*
$($f_metric: raw::UIntGaugeVec,)*
Expand All @@ -70,7 +69,6 @@ macro_rules! metrics_size_class {
fn new(registry: &MetricsRegistry) -> Self {
Self {
size_class: BTreeMap::default(),
stats: lgalloc::LgAllocStats::default(),
$($metric: registry.register(mz_ore::metric!(
name: concat!(stringify!($namespace), "_", stringify!($metric)),
help: $desc,
Expand All @@ -93,22 +91,25 @@ macro_rules! metrics_size_class {
})
}
fn update(&mut self) {
let mut stats = std::mem::take(&mut self.stats);
lgalloc::lgalloc_stats(&mut stats);
let stats = lgalloc::lgalloc_stats();
for sc in &stats.size_class {
let sc_stats = self.get_size_class(sc.size_class);
$(sc_stats.$metric.set(($conv)(u64::cast_from(sc.$name), sc));)*
}
let mut accums = BTreeMap::new();
for file_stat in &stats.file_stats {
let accum: &mut FileStatsAccum = accums.entry(file_stat.size_class).or_default();
accum.add_assign(file_stat);
match &stats.file_stats {
Ok(file_stats) => {
for file_stat in file_stats {
let accum: &mut FileStatsAccum = accums.entry(file_stat.size_class).or_default();
accum.add_assign(file_stat);
}
}
Err(err) => eprintln!("Failed to get file stats: {err}"),
}
for (size_class, accum) in accums {
let sc_stats = self.get_size_class(size_class);
$(sc_stats.$f_metric.set(u64::cast_from(accum.$f_name));)*
}
self.stats = stats;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ flatcontainer = { version = "0.5.0", optional = true }
futures = { version = "0.3.25", optional = true }
hibitset = { version = "0.6.4", optional = true }
itertools = "0.10.5"
lgalloc = { version = "0.3", optional = true }
lgalloc = { version = "0.4", optional = true }
libc = { version = "0.2.138", optional = true }
mz-ore-proc = { path = "../ore-proc", default-features = false }
num = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion src/timely-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ columnation = "0.1.0"
differential-dataflow = "0.13.1"
either = "1"
futures-util = "0.3.25"
lgalloc = "0.3"
lgalloc = "0.4"
mz-ore = { path = "../ore", features = ["async", "process", "tracing_", "test"] }
num-traits = "0.2"
proptest = { version = "1.0.0", default-features = false, features = ["std"] }
Expand Down

0 comments on commit 4035b31

Please sign in to comment.