feat: Add --info command and refactor config module (#2234)

Signed-off-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2026-03-20 01:16:45 +08:00
committed by GitHub
parent e1a278aaf8
commit 28f86a505e
19 changed files with 1839 additions and 482 deletions
+17 -3
View File
@@ -12,9 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::config::workload_profiles::{
RustFSBufferConfig, WorkloadProfile, get_global_buffer_config, is_buffer_profile_enabled,
};
use crate::config::{RustFSBufferConfig, WorkloadProfile, get_global_buffer_config, is_buffer_profile_enabled};
use crate::error::ApiError;
use crate::server::cors;
use crate::storage::ecfs::ListObjectUnorderedQuery;
@@ -119,6 +117,22 @@ pub(crate) fn apply_lock_retention(object_lock_config: Option<ObjectLockConfigur
/// 10 * 1024 * 1024,
/// Some(WorkloadProfile::SecureStorage)
/// );
///
/// // Use custom profile for specialized requirements
/// let custom_profile = WorkloadProfile::custom(
/// 32 * 1024, // min_size: 32KB
/// 2 * 1024 * 1024, // max_size: 2MB
/// 256 * 1024, // default_unknown: 256KB
/// vec![
/// (1024 * 1024, 64 * 1024), // < 1MB: 64KB
/// (10 * 1024 * 1024, 128 * 1024), // 1MB-10MB: 128KB
/// (i64::MAX, 512 * 1024), // >= 10MB: 512KB
/// ],
/// );
/// let buffer_size = get_adaptive_buffer_size_with_profile(
/// 5 * 1024 * 1024,
/// Some(custom_profile)
/// );
/// ```
///
#[allow(dead_code)]