From e2fb0427f91e2c264ac7524a2d2505477345eb06 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Thu, 13 Aug 2026 04:41:40 +0800 Subject: [PATCH] docs(io-metrics): remove stale unified-config docs left by #6008 (#6039) PR #6008 deleted crates/io-metrics/src/config.rs but the crate docs still taught the deleted API: both READMEs kept the Unified Configuration sections, module-tree entries and ./src/config.rs links, the example kept an orphaned numbered comment, and the io-core/io-metrics changelog had no removal record. Scrub all of it; keep cache_config.rs references, which are still real. --- crates/io-core/CHANGELOG.md | 7 ++++ crates/io-metrics/README.md | 27 ------------ crates/io-metrics/README_zh.md | 42 ------------------- crates/io-metrics/examples/metrics_example.rs | 4 +- 4 files changed, 8 insertions(+), 72 deletions(-) diff --git a/crates/io-core/CHANGELOG.md b/crates/io-core/CHANGELOG.md index 248012cee..2ed1235c4 100644 --- a/crates/io-core/CHANGELOG.md +++ b/crates/io-core/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to the rustfs-io-core and rustfs-io-metrics crates will be d The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Removed + +#### rustfs-io-metrics +- **Unified configuration** (added in 0.0.5): the zero-consumer `IoConfig`, `CacheSettings`, `IoSchedulerSettings`, `BackpressureSettings`, `TimeoutSettings`, `DeadlockDetectionSettings` types and their `DEFAULT_*` constants were removed (rustfs/rustfs#6008); rustfs-io-core's `IoSchedulerConfig`/`BackpressureConfig` remain the canonical configuration types. + ## [0.0.5] - 2025-01-XX ### Added diff --git a/crates/io-metrics/README.md b/crates/io-metrics/README.md index 4cbb75410..9cc9cf003 100644 --- a/crates/io-metrics/README.md +++ b/crates/io-metrics/README.md @@ -27,7 +27,6 @@ - **Metrics Collection**: Unified metrics recording and reporting - **Bandwidth Monitoring**: Real-time bandwidth observation and analysis - **Performance Metrics**: I/O performance metrics collection -- **Unified Configuration**: Centralized configuration management - **Exporter Boundary**: Emit via `metrics`, export via `rustfs-obs`, no Prometheus HTTP endpoint ## Features @@ -203,30 +202,6 @@ path and include: deltas with `operation` and `backend` columns, so the TCP baseline can attribute bytes and request/error counts to `tcp-http` transport operations. -### Unified Configuration - -Centralized configuration management: - -```rust -use rustfs_io_metrics::{ - IoConfig, CacheSettings, IoSchedulerSettings, - BackpressureSettings, TimeoutSettings, -}; - -let config = IoConfig::new() - .with_cache(CacheSettings::new() - .with_max_capacity(10_000) - .with_ttl(std::time::Duration::from_secs(300))) - .with_scheduler(IoSchedulerSettings::new() - .with_max_concurrent_reads(64)) - .with_backpressure(BackpressureSettings::new()) - .with_timeout(TimeoutSettings::new()); - -// Access configuration -println!("Cache capacity: {}", config.cache.max_capacity); -println!("Max concurrent reads: {}", config.scheduler.max_concurrent_reads); -``` - ## Module Structure ``` @@ -235,7 +210,6 @@ rustfs-io-metrics/ │ ├── lib.rs # Module entry │ ├── cache_config.rs # Cache configuration │ ├── adaptive_ttl.rs # Adaptive TTL -│ ├── config.rs # Unified configuration │ ├── io_metrics.rs # I/O metrics │ ├── backpressure_metrics.rs # Backpressure metrics │ ├── deadlock_metrics.rs # Deadlock metrics @@ -278,7 +252,6 @@ Useful source references: - [Crate API overview](./src/lib.rs) - [Metrics example](./examples/metrics_example.rs) -- [Configuration module](./src/config.rs) - [Adaptive TTL module](./src/adaptive_ttl.rs) ## Related Modules diff --git a/crates/io-metrics/README_zh.md b/crates/io-metrics/README_zh.md index 62d758820..139961306 100644 --- a/crates/io-metrics/README_zh.md +++ b/crates/io-metrics/README_zh.md @@ -27,7 +27,6 @@ - **指标收集**:统一的指标记录和上报 - **带宽监控**:实时带宽观测和分析 - **性能指标**:I/O 性能指标收集 -- **统一配置**:集中式配置管理 - **导出边界**:通过 `metrics` 主动上报,由 `rustfs-obs` 负责 OTEL 导出,不提供 Prometheus HTTP 端点 ## ✨ 核心功能 @@ -172,30 +171,6 @@ println!("读取速率: {} bytes/s", snapshot.read_bytes_per_sec); println!("写入速率: {} bytes/s", snapshot.write_bytes_per_sec); ``` -### 统一配置 (IoConfig) - -集中式配置管理: - -```rust -use rustfs_io_metrics::{ - IoConfig, CacheSettings, IoSchedulerSettings, - BackpressureSettings, TimeoutSettings, -}; - -let config = IoConfig::new() - .with_cache(CacheSettings::new() - .with_max_capacity(10_000) - .with_ttl(std::time::Duration::from_secs(300))) - .with_scheduler(IoSchedulerSettings::new() - .with_max_concurrent_reads(64)) - .with_backpressure(BackpressureSettings::new()) - .with_timeout(TimeoutSettings::new()); - -// 访问配置 -println!("缓存容量: {}", config.cache.max_capacity); -println!("最大并发读: {}", config.scheduler.max_concurrent_reads); -``` - ## 📊 指标类型 ### I/O 调度指标 @@ -233,21 +208,6 @@ println!("最大并发读: {}", config.scheduler.max_concurrent_reads); | `operation_duration_secs` | 操作时长 | Histogram | | `operation_progress` | 操作进度 | Gauge | -## 🔧 配置 - -### 代码配置 - -```rust -use rustfs_io_metrics::{CacheSettings, IoConfig}; - -let settings = CacheSettings::new() - .with_max_capacity(5000) - .with_ttl(std::time::Duration::from_secs(600)) - .with_max_memory(200 * 1024 * 1024); - -let config = IoConfig::new().with_cache(settings); -``` - ## 📁 模块结构 ``` @@ -256,7 +216,6 @@ rustfs-io-metrics/ │ ├── lib.rs # 模块入口 │ ├── cache_config.rs # 缓存配置 │ ├── adaptive_ttl.rs # 自适应 TTL -│ ├── config.rs # 统一配置 │ ├── io_metrics.rs # I/O 指标 │ ├── backpressure_metrics.rs # 背压指标 │ ├── deadlock_metrics.rs # 死锁指标 @@ -297,7 +256,6 @@ cargo doc --package rustfs-io-metrics --no-deps --open - [Crate API 概览](./src/lib.rs) - [指标示例](./examples/metrics_example.rs) -- [配置模块](./src/config.rs) - [自适应 TTL 模块](./src/adaptive_ttl.rs) ## 🔗 相关模块 diff --git a/crates/io-metrics/examples/metrics_example.rs b/crates/io-metrics/examples/metrics_example.rs index f28a26636..2280bf21b 100644 --- a/crates/io-metrics/examples/metrics_example.rs +++ b/crates/io-metrics/examples/metrics_example.rs @@ -29,9 +29,7 @@ fn main() { // 3. Access tracking example access_tracker_example(); - // 4. Unified configuration example - - // 5. Metrics recording example + // 4. Metrics recording example metrics_recording_example(); }