Skip to content

Commit ed95b9a

Browse files
authored
Merge branch 'master' into add-histogram-count-and-sum-accessors
2 parents 603395c + e45cecf commit ed95b9a

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ axum = "0.7"
3838
criterion = "0.5"
3939
futures = "0.3"
4040
http-types = "2"
41-
pyo3 = "0.22"
41+
pyo3 = "0.27"
4242
quickcheck = "1"
4343
rand = "0.8.4"
4444
tide = "0.16"

src/encoding/text.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,21 +1251,21 @@ mod tests {
12511251
}
12521252

12531253
fn parse_with_python_client(input: String) {
1254-
pyo3::prepare_freethreaded_python();
1254+
pyo3::Python::initialize();
12551255

12561256
println!("{input:?}");
1257-
Python::with_gil(|py| {
1258-
let parser = PyModule::from_code_bound(
1257+
Python::attach(|py| {
1258+
let parser = PyModule::from_code(
12591259
py,
1260-
r#"
1260+
c"
12611261
from prometheus_client.openmetrics.parser import text_string_to_metric_families
12621262
12631263
def parse(input):
12641264
families = text_string_to_metric_families(input)
12651265
list(families)
1266-
"#,
1267-
"parser.py",
1268-
"parser",
1266+
",
1267+
c"parser.py",
1268+
c"parser",
12691269
)
12701270
.map_err(|e| e.to_string())
12711271
.unwrap();

src/metrics/counter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ mod tests {
265265
// Map infinite, subnormal and NaN to 0.0.
266266
.map(|f| if f.is_normal() { f } else { 0.0 })
267267
.collect();
268-
let sum = fs.iter().sum();
268+
let sum: f64 = fs.iter().sum();
269269
let counter = Counter::<f64, AtomicU64>::default();
270270
for f in fs {
271271
counter.inc_by(f);

src/registry.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ impl Registry {
228228
/// let subsystem_a_counter_2: Counter = Counter::default();
229229
///
230230
/// let subsystem_a_registry = registry.sub_registry_with_prefix("subsystem_a");
231-
/// registry.register("counter_1", "", subsystem_a_counter_1.clone());
232-
/// registry.register("counter_2", "", subsystem_a_counter_2.clone());
231+
/// subsystem_a_registry.register("counter_1", "", subsystem_a_counter_1.clone());
232+
/// subsystem_a_registry.register("counter_2", "", subsystem_a_counter_2.clone());
233233
///
234234
/// let subsystem_b_counter_1: Counter = Counter::default();
235235
/// let subsystem_b_counter_2: Counter = Counter::default();
236236
///
237-
/// let subsystem_a_registry = registry.sub_registry_with_prefix("subsystem_b");
238-
/// registry.register("counter_1", "", subsystem_b_counter_1.clone());
239-
/// registry.register("counter_2", "", subsystem_b_counter_2.clone());
237+
/// let subsystem_b_registry = registry.sub_registry_with_prefix("subsystem_b");
238+
/// subsystem_b_registry.register("counter_1", "", subsystem_b_counter_1.clone());
239+
/// subsystem_b_registry.register("counter_2", "", subsystem_b_counter_2.clone());
240240
/// ```
241241
///
242242
/// See [`Registry::sub_registry_with_label`] for the same functionality,

0 commit comments

Comments
 (0)