Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics: stabilize RuntimeMetrics::worker_count #6556

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CR feedback
  • Loading branch information
rcoh committed May 28, 2024
commit 54aad73e85e8c1449c38a0559e2aee42cedfea54
4 changes: 1 addition & 3 deletions tokio/src/runtime/handle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(tokio_unstable)]
use crate::runtime;
use crate::runtime::{context, scheduler, RuntimeFlavor};
use crate::runtime::{context, scheduler, RuntimeFlavor, RuntimeMetrics};

/// Handle to the runtime.
///
Expand All @@ -22,8 +22,6 @@ use std::future::Future;
use std::marker::PhantomData;
use std::{error, fmt};

use super::RuntimeMetrics;

/// Runtime context guard.
///
/// Returned by [`Runtime::enter`] and [`Handle::enter`], the context guard exits
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/metrics/histogram.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::loom::sync::atomic::Ordering::Relaxed;
use crate::util::metric_atomics::MetricAtomicU64;
use std::sync::atomic::Ordering::Relaxed;

use std::cmp;
use std::ops::Range;
Expand Down
3 changes: 2 additions & 1 deletion tokio/src/runtime/metrics/io.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![cfg_attr(not(feature = "net"), allow(dead_code))]

use crate::{loom::sync::atomic::Ordering::Relaxed, util::metric_atomics::MetricAtomicU64};
use crate::util::metric_atomics::MetricAtomicU64;
use std::sync::atomic::Ordering::Relaxed;

#[derive(Default)]
pub(crate) struct IoDriverMetrics {
Expand Down
2 changes: 2 additions & 0 deletions tokio/src/runtime/metrics/worker.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::runtime::metrics::Histogram;
use crate::runtime::Config;
use crate::util::metric_atomics::MetricAtomicU64;
// This is NOT the Loom atomic. To avoid an unnecessary state explosion in loom,
// all metrics use regular atomics.
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::Relaxed;

Expand Down
Loading