use rustkernel_core::runtime::{RuntimeConfig, RuntimePreset};
// Development: relaxed timeouts, verbose logging
let config = RuntimeConfig::development();
// Production: optimized for reliability
let config = RuntimeConfig::production();
// High-performance: maximum throughput
let config = RuntimeConfig::high_performance();
use rustkernel_core::memory::KernelMemoryManager;
let manager = KernelMemoryManager::new(config);
// Allocate from pool
let buffer = manager.allocate(1024 * 1024)?; // 1MB
// Return to pool
manager.deallocate(buffer);
// Check stats
let stats = manager.stats();
println!("Allocated: {} bytes", stats.allocated_bytes);
println!("Pool utilization: {:.1}%", stats.pool_utilization * 100.0);
use rustkernel_core::config::{ProductionConfig, ProductionConfigBuilder};
// Load from environment
let config = ProductionConfig::from_env()?;
// Load from file
let config = ProductionConfig::from_file("config/production.toml")?;
// Use builder
let config = ProductionConfigBuilder::production()
.service_name("my-kernel-service")
.environment("production")
.runtime(|r| r
.max_kernel_instances(500)
.shutdown_timeout(Duration::from_secs(60)))
.memory(|m| m
.max_gpu_memory(16 * 1024 * 1024 * 1024))
.build()?;
// Validate
config.validate()?;
# Show runtime status
rustkernel runtime status
# Show current configuration
rustkernel runtime show
# Initialize with preset
rustkernel runtime init --preset production
# Generate config template
rustkernel config generate --preset production --output config.toml
# Validate config file
rustkernel config validate config.toml
# Show environment variables
rustkernel config env