Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
Cargo.lock
.vscode
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## How to test docs.rs changes

Set up your local docs.rs environment as per official README:
https://github.com/rust-lang/docs.rs?tab=readme-ov-file#getting-started

Make sure you have:
- Your .env contents exported
- docker-compose for db and s3 running
- The web server running via local (or pure docker-compose approach)
- If on a remote machine, port 3000 (or whatever your webserver is listening on) forwarded

Invoke the build command against your local path:

```
# you could also point to the `cratesfyi` binary from outside of the docker workspace,
# though you'll still need the right ENVs exported
cargo run -- build crate --local ../tokio-metrics
```

View the generated documentation for `tokio-metrics` in your browser
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@ cfg_rt! {
RuntimeMetrics,
RuntimeMonitor,
};
#[cfg(feature = "metrics-rs-integration")]
pub use runtime::metrics_rs_integration::{RuntimeMetricsReporterBuilder, RuntimeMetricsReporter};
}

#[cfg(all(tokio_unstable, feature = "rt", feature = "metrics-rs-integration"))]
#[cfg_attr(
docsrs,
doc(cfg(all(tokio_unstable, feature = "rt", feature = "metrics-rs-integration")))
)]
pub use runtime::metrics_rs_integration::{RuntimeMetricsReporter, RuntimeMetricsReporterBuilder};

mod task;
pub use task::{Instrumented, TaskMetrics, TaskMonitor};
4 changes: 0 additions & 4 deletions src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use tokio::runtime;
#[cfg(feature = "metrics-rs-integration")]
pub(crate) mod metrics_rs_integration;

#[cfg(any(docsrs, all(tokio_unstable, feature = "rt")))]
#[cfg_attr(docsrs, doc(cfg(all(tokio_unstable, feature = "rt"))))]
/// Monitors key metrics of the tokio runtime.
///
/// ### Usage
Expand Down Expand Up @@ -53,8 +51,6 @@ pub struct RuntimeMonitor {
runtime: runtime::RuntimeMetrics,
}

#[cfg(any(docsrs, all(tokio_unstable, feature = "rt")))]
#[cfg_attr(docsrs, doc(cfg(all(tokio_unstable, feature = "rt"))))]
/// Key runtime metrics.
#[non_exhaustive]
#[derive(Default, Debug, Clone)]
Expand Down
Loading