Skip to content

Commit

Permalink
Moved to portable-atomic
Browse files Browse the repository at this point in the history
Complete support of all required methods
  • Loading branch information
huntc committed Jul 16, 2022
1 parent d082f14 commit e290ea4
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion metrics-benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ pretty_env_logger = "0.4"
getopts = "0.2"
hdrhistogram = { version = "7.2", default-features = false }
quanta = "0.10.0"
atomic-shim = "0.2"
portable-atomic = "0.3"
metrics = { version = "^0.19", path = "../metrics" }
metrics-util = { version = "^0.13", path = "../metrics-util" }
2 changes: 1 addition & 1 deletion metrics-benchmark/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use atomic_shim::AtomicU64;
use getopts::Options;
use hdrhistogram::Histogram as HdrHistogram;
use log::{error, info};
Expand All @@ -7,6 +6,7 @@ use metrics::{
Counter, Gauge, Histogram, Key, KeyName, Recorder, SharedString, Unit,
};
use metrics_util::registry::{AtomicStorage, Registry};
use portable_atomic::AtomicU64;
use quanta::{Clock, Instant as QuantaInstant};
use std::{
env,
Expand Down
1 change: 1 addition & 0 deletions metrics-exporter-prometheus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ parking_lot = { version = "0.11", default-features = false }
thiserror = { version = "1", default-features = false }
quanta = { version = "0.10.0", default-features = false }
indexmap = { version = "1", default-features = false }
portable-atomic = "0.3"

# Optional
hyper = { version = "0.14", default-features = false, features = ["tcp", "http1"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion metrics-exporter-prometheus/src/registry.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::sync::atomic::AtomicU64;
use portable_atomic::AtomicU64;
use std::sync::Arc;

use metrics::HistogramFn;
Expand Down
4 changes: 2 additions & 2 deletions metrics-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ required-features = ["handles"]
metrics = { version = "^0.19", path = "../metrics" }
crossbeam-epoch = { version = "0.9.2", default-features = false, optional = true, features = ["alloc", "std"] }
crossbeam-utils = { version = "0.8", default-features = false, optional = true }
atomic-shim = { version = "0.2", default-features = false, optional = true }
portable-atomic = { version = "0.3", optional = true }
aho-corasick = { version = "0.7", default-features = false, optional = true, features = ["std"] }
indexmap = { version = "1", default-features = false, optional = true }
parking_lot = { version = "0.11", default-features = false, optional = true }
Expand Down Expand Up @@ -90,4 +90,4 @@ layer-filter = ["aho-corasick"]
layer-router = ["radix_trie"]
summary = ["sketches-ddsketch"]
recency = ["parking_lot", "registry", "quanta"]
registry = ["atomic-shim", "crossbeam-epoch", "crossbeam-utils", "handles", "hashbrown", "num_cpus", "parking_lot"]
registry = ["portable-atomic", "crossbeam-epoch", "crossbeam-utils", "handles", "hashbrown", "num_cpus", "parking_lot"]
2 changes: 1 addition & 1 deletion metrics-util/src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ where

#[cfg(test)]
mod tests {
use atomic_shim::AtomicU64;
use metrics::{CounterFn, Key};
use portable_atomic::AtomicU64;

use super::Registry;
use std::sync::{atomic::Ordering, Arc};
Expand Down
2 changes: 1 addition & 1 deletion metrics-util/src/registry/storage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use atomic_shim::AtomicU64;
use metrics::{CounterFn, GaugeFn, HistogramFn};
use portable_atomic::AtomicU64;

use crate::AtomicBucket;

Expand Down
2 changes: 1 addition & 1 deletion metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ harness = false
[dependencies]
metrics-macros = { version = "^0.5", path = "../metrics-macros" }
ahash = { version = "0.7", default-features = false }
atomic-shim = "0.2"
portable-atomic = "0.3"

[dev-dependencies]
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion metrics/src/handles.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use atomic_shim::AtomicU64;
use portable_atomic::AtomicU64;
use std::sync::{atomic::Ordering, Arc};

use crate::IntoF64;
Expand Down
2 changes: 1 addition & 1 deletion metrics/src/key.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{cow::Cow, IntoLabels, KeyHasher, Label, SharedString};
use alloc::{string::String, vec::Vec};
use atomic_shim::AtomicU64;
use core::{fmt, hash::Hash, slice::Iter};
use portable_atomic::AtomicU64;
use std::{
cmp,
hash::Hasher,
Expand Down

0 comments on commit e290ea4

Please sign in to comment.