use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SystemProfile {
pub cpu_score: f64,
pub gpu_score: f64,
pub npu_score: f64,
pub tpu_score: f64,
pub fpga_score: f64,
pub ai_accelerator_score: f64,
pub arm_optimization_score: f64,
pub memory_score: f64,
pub storage_score: f64,
pub network_score: f64,
pub overall_score: f64,
pub ai_workload_score: f64,
pub edge_computing_score: f64,
pub system_info: SystemInfo,
pub created_at: DateTime<Utc>,
}
impl SystemProfile {
#[allow(clippy::too_many_arguments)]
pub fn new(
cpu_score: f64,
gpu_score: f64,
npu_score: f64,
tpu_score: f64,
fpga_score: f64,
arm_optimization_score: f64,
memory_score: f64,
storage_score: f64,
network_score: f64,
system_info: SystemInfo,
) -> Self {
SystemProfileBuilder::new()
.cpu_score(cpu_score)
.gpu_score(gpu_score)
.npu_score(npu_score)
.tpu_score(tpu_score)
.fpga_score(fpga_score)
.arm_optimization_score(arm_optimization_score)
.memory_score(memory_score)
.storage_score(storage_score)
.network_score(network_score)
.system_info(system_info)
.build()
}
pub fn builder() -> SystemProfileBuilder {
SystemProfileBuilder::new()
}
pub fn cpu_score(&self) -> f64 {
self.cpu_score
}
pub fn gpu_score(&self) -> f64 {
self.gpu_score
}
pub fn memory_score(&self) -> f64 {
self.memory_score
}
pub fn storage_score(&self) -> f64 {
self.storage_score
}
pub fn network_score(&self) -> f64 {
self.network_score
}
pub fn overall_score(&self) -> f64 {
self.overall_score
}
pub fn ai_workload_score(&self) -> f64 {
self.ai_workload_score
}
pub fn edge_computing_score(&self) -> f64 {
self.edge_computing_score
}
pub fn ai_accelerator_score(&self) -> f64 {
self.ai_accelerator_score
}
pub fn has_ai_accelerators(&self) -> bool {
!self.system_info.npu_info.is_empty() ||
!self.system_info.tpu_info.is_empty() ||
!self.system_info.fpga_info.is_empty()
}
pub fn total_tops_performance(&self) -> f64 {
let npu_tops: f64 = self.system_info.npu_info.iter()
.filter_map(|npu| npu.tops_performance)
.sum();
let tpu_tops: f64 = self.system_info.tpu_info.iter()
.filter_map(|tpu| tpu.tops_performance)
.sum();
npu_tops + tpu_tops
}
pub fn is_arm_system(&self) -> bool {
self.system_info.arm_info.is_some()
}
pub fn arm_system_type(&self) -> Option<&str> {
self.system_info.arm_info.as_ref().map(|arm| arm.system_type.as_str())
}
pub fn is_suitable_for_ai_workload(&self, workload_type: &str) -> bool {
match workload_type.to_lowercase().as_str() {
"inference" => self.ai_workload_score >= 6.0,
"training" => self.ai_workload_score >= 8.0 && self.gpu_score >= 7.0,
"edge" => self.edge_computing_score >= 7.0,
"lightweight" => self.ai_workload_score >= 4.0,
_ => self.ai_workload_score >= 6.0,
}
}
pub fn system_hash(&self) -> String {
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
let mut hasher = DefaultHasher::new();
self.cpu_score.to_bits().hash(&mut hasher);
self.gpu_score.to_bits().hash(&mut hasher);
self.memory_score.to_bits().hash(&mut hasher);
self.system_info.cpu_info.physical_cores.hash(&mut hasher);
self.system_info.cpu_info.logical_cores.hash(&mut hasher);
self.system_info.memory_info.total_ram.hash(&mut hasher);
self.system_info.gpu_info.len().hash(&mut hasher);
format!("{:x}", hasher.finish())
}
pub fn ai_capabilities(&self) -> AICapabilities {
AICapabilities {
inference_capability: self.neural_inference_capability(),
training_capability: self.neural_training_capability(),
edge_capability: self.edge_computing_capability(),
max_model_size: self.max_supported_model_size(),
llm_capability: self.llm_capability(),
computer_vision_capability: self.computer_vision_capability(),
supported_frameworks: self.supported_frameworks(),
}
}
pub fn neural_inference_capability(&self) -> CapabilityLevel {
if self.ai_accelerator_score >= 8.0 {
CapabilityLevel::Exceptional
} else if self.ai_accelerator_score >= 5.0 {
CapabilityLevel::VeryHigh
} else if self.gpu_score >= 7.0 {
CapabilityLevel::High
} else if self.gpu_score >= 5.0 {
CapabilityLevel::Medium
} else {
CapabilityLevel::Basic
}
}
pub fn neural_training_capability(&self) -> CapabilityLevel {
if self.ai_accelerator_score >= 9.0 && self.memory_score >= 8.0 {
CapabilityLevel::Exceptional
} else if self.gpu_score >= 8.0 && self.memory_score >= 7.0 {
CapabilityLevel::VeryHigh
} else if self.gpu_score >= 6.0 {
CapabilityLevel::High
} else if self.gpu_score >= 4.0 {
CapabilityLevel::Medium
} else {
CapabilityLevel::Basic
}
}
pub fn edge_computing_capability(&self) -> CapabilityLevel {
if self.edge_computing_score >= 8.0 {
CapabilityLevel::Exceptional
} else if self.edge_computing_score >= 6.0 {
CapabilityLevel::VeryHigh
} else if self.edge_computing_score >= 4.0 {
CapabilityLevel::Medium
} else {
CapabilityLevel::Basic
}
}
pub fn max_supported_model_size(&self) -> f64 {
let mut base_memory_gb = self.system_info.memory_info.total_ram as f64 / 1024.0 / 2.0;
let gpu_memory_gb = self.system_info.gpu_info.iter()
.filter_map(|gpu| gpu.vram_size)
.map(|vram| vram as f64 / 1024.0) .max_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal))
.unwrap_or(0.0);
if gpu_memory_gb > 0.0 {
base_memory_gb = base_memory_gb.max(gpu_memory_gb * 0.8);
}
if !self.system_info.npu_info.is_empty() || !self.system_info.tpu_info.is_empty() {
base_memory_gb *= 2.0; } else if self.gpu_score >= 7.0 {
base_memory_gb *= 1.5; }
base_memory_gb
}
pub fn llm_capability(&self) -> LLMCapability {
let max_model_size = self.max_supported_model_size();
if max_model_size >= 100.0 && self.ai_accelerator_score >= 8.0 {
LLMCapability::Enterprise } else if max_model_size >= 40.0 && self.ai_workload_score >= 7.0 {
LLMCapability::Advanced } else if max_model_size >= 16.0 && self.ai_workload_score >= 6.0 {
LLMCapability::Standard } else if max_model_size >= 8.0 && self.ai_workload_score >= 5.0 {
LLMCapability::Basic } else if max_model_size >= 4.0 {
LLMCapability::Minimal } else {
LLMCapability::Unsuitable
}
}
pub fn computer_vision_capability(&self) -> CapabilityLevel {
if self.ai_accelerator_score >= 7.0 || self.gpu_score >= 8.0 {
CapabilityLevel::Exceptional } else if self.gpu_score >= 6.0 {
CapabilityLevel::VeryHigh } else if self.gpu_score >= 4.0 {
CapabilityLevel::High } else if self.gpu_score >= 2.0 {
CapabilityLevel::Medium } else {
CapabilityLevel::Basic }
}
pub fn supported_frameworks(&self) -> Vec<String> {
let mut frameworks = Vec::new();
frameworks.push("ONNX Runtime".to_string());
frameworks.push("TensorFlow Lite".to_string());
if !self.system_info.gpu_info.is_empty() {
let has_cuda = self.system_info.gpu_info.iter().any(|gpu| gpu.cuda_support);
if has_cuda {
frameworks.push("TensorFlow".to_string());
frameworks.push("PyTorch".to_string());
frameworks.push("JAX".to_string());
}
frameworks.push("OpenVINO".to_string());
frameworks.push("DirectML".to_string());
}
for npu in &self.system_info.npu_info {
frameworks.extend(npu.supported_frameworks.clone());
}
for tpu in &self.system_info.tpu_info {
frameworks.extend(tpu.supported_frameworks.clone());
}
frameworks.sort();
frameworks.dedup();
frameworks
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SystemInfo {
pub os_name: String,
pub os_version: String,
pub cpu_info: CpuInfo,
pub gpu_info: Vec<GpuInfo>,
pub npu_info: Vec<NpuInfo>,
pub tpu_info: Vec<TpuInfo>,
pub fpga_info: Vec<FpgaInfo>,
pub arm_info: Option<ArmInfo>,
pub memory_info: MemoryInfo,
pub storage_info: Vec<StorageInfo>,
pub network_info: NetworkInfo,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CpuInfo {
pub brand: String,
pub physical_cores: usize,
pub logical_cores: usize,
pub base_frequency: u64,
pub max_frequency: Option<u64>,
pub cache_size: Option<u64>,
pub architecture: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GpuInfo {
pub name: String,
pub vendor: String,
pub vram_size: Option<u64>,
pub compute_capability: Option<String>,
pub opencl_support: bool,
pub cuda_support: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NpuInfo {
pub vendor: String,
pub model_name: String,
pub tops_performance: Option<f64>,
pub supported_frameworks: Vec<String>,
pub supported_dtypes: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TpuInfo {
pub vendor: String,
pub model_name: String,
pub architecture: String,
pub tops_performance: Option<f64>,
pub supported_frameworks: Vec<String>,
pub supported_dtypes: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FpgaInfo {
pub vendor: String,
pub family: String,
pub model_name: String,
pub logic_elements: Option<u64>,
pub memory_blocks: Option<u64>,
pub dsp_blocks: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ArmInfo {
pub system_type: String,
pub board_model: String,
pub cpu_architecture: String,
pub acceleration_features: Vec<String>,
pub ml_capabilities: HashMap<String, String>,
pub interfaces: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MemoryInfo {
pub total_ram: u64,
pub available_ram: u64,
pub memory_type: Option<String>,
pub memory_speed: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StorageInfo {
pub name: String,
pub storage_type: String,
pub total_capacity: u64,
pub available_capacity: u64,
pub read_speed: Option<u64>,
pub write_speed: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NetworkInfo {
pub interfaces: Vec<NetworkInterface>,
pub internet_connected: bool,
pub estimated_bandwidth: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NetworkInterface {
pub name: String,
pub interface_type: String,
pub mac_address: String,
pub ip_addresses: Vec<String>,
pub speed: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AICapabilities {
pub inference_capability: CapabilityLevel,
pub training_capability: CapabilityLevel,
pub edge_capability: CapabilityLevel,
pub max_model_size: f64,
pub llm_capability: LLMCapability,
pub computer_vision_capability: CapabilityLevel,
pub supported_frameworks: Vec<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum CapabilityLevel {
Basic,
Medium,
High,
VeryHigh,
Exceptional,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum LLMCapability {
Unsuitable,
Minimal,
Basic,
Standard,
Advanced,
Enterprise,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AIAcceleratorType {
GPU,
NPU,
TPU,
FPGA,
CPU,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AIWorkloadRequirements {
pub base_requirements: String,
pub required_accelerator_types: Vec<AIAcceleratorType>,
pub required_tops: Option<f64>,
pub preferred_accelerator: Option<AIAcceleratorType>,
pub required_model_memory: f64,
pub supported_quantization: Vec<crate::workloads::QuantizationLevel>,
pub min_inference_speed: Option<f64>,
pub required_frameworks: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ModelCompatibilityResult {
pub can_run: bool,
pub memory_sufficient: bool,
pub accelerator_compatibility: AcceleratorCompatibility,
pub optimal_quantization: QuantizationSuggestion,
pub expected_inference_speed: f64,
pub bottlenecks: Vec<ModelBottleneck>,
pub recommended_batch_size: u32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AcceleratorCompatibility {
pub is_compatible: bool,
pub compatible_devices: Vec<AcceleratorDevice>,
pub recommended_device: Option<AcceleratorDevice>,
pub expected_performance: PerformanceLevel,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum AcceleratorDevice {
CPU,
GPU,
NPU,
TPU,
FPGA,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QuantizationSuggestion {
pub recommended_level: crate::workloads::QuantizationLevel,
pub reasoning: String,
pub performance_impact: PerformanceImpact,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum PerformanceImpact {
Positive,
Negative,
Mixed,
None,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum PerformanceLevel {
VeryLow,
Low,
Medium,
High,
VeryHigh,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ModelBottleneck {
pub bottleneck_type: ModelBottleneckType,
pub description: String,
pub severity: BottleneckSeverity,
pub recommendation: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelBottleneckType {
Memory,
Compute,
DataTransfer,
Precision,
FrameworkSupport,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum BottleneckSeverity {
Low,
Medium,
High,
Critical,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CostEstimate {
pub min_cost_usd: f64,
pub max_cost_usd: f64,
pub currency: String,
pub breakdown: Vec<CostBreakdownItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CostBreakdownItem {
pub component: String,
pub cost_usd: f64,
pub description: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum UpgradePriority {
Low,
Medium,
High,
Critical,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum WorkloadPriority {
Low,
Medium,
High,
Critical,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum RequirementSeverity {
Low,
Medium,
High,
Critical,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompatibilityResult {
pub is_compatible: bool,
pub score: f64,
pub performance_estimate: PerformanceEstimate,
pub missing_requirements: Vec<MissingRequirement>,
pub bottlenecks: Vec<Bottleneck>,
pub recommendations: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PerformanceEstimate {
pub tier: PerformanceTier,
pub utilization_percent: f64,
pub latency_ms: f64,
pub throughput: f64,
pub estimated_latency_ms: f64,
pub estimated_throughput: f64,
pub confidence: f64,
pub performance_tier: PerformanceTier,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum PerformanceTier {
Low,
Medium,
High,
VeryHigh,
Excellent,
Good,
Fair,
Poor,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MissingRequirement {
pub resource_type: String,
pub required: String,
pub current: String,
pub available: String,
pub severity: RequirementSeverity,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bottleneck {
pub resource_type: String,
pub description: String,
pub impact: BottleneckImpact,
pub solution: String,
pub suggestions: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum BottleneckImpact {
Low,
Medium,
High,
Critical,
Severe,
Moderate,
Minor,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpgradeRecommendation {
pub component: String,
pub description: String,
pub priority: UpgradePriority,
pub estimated_cost: Option<CostEstimate>,
pub resource_type: crate::resources::ResourceType,
pub recommendation: String,
pub estimated_improvement: String,
pub cost_estimate: Option<CostEstimate>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OptimalConfiguration {
pub name: String,
pub cpu_recommendation: String,
pub gpu_recommendation: Option<String>,
pub memory_gb: f64,
pub storage_gb: f64,
pub estimated_cost: Option<CostEstimate>,
pub memory_recommendation: String,
pub storage_recommendation: String,
pub network_recommendation: String,
pub total_cost: Option<CostEstimate>,
pub performance_projection: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ResourceUtilization {
pub cpu_percent: f64,
pub memory_percent: f64,
pub storage_percent: f64,
pub network_percent: f64,
pub gpu_percent: f64,
pub peak_utilization: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PerformanceTargets {
pub target_latency_ms: f64,
pub target_throughput: f64,
pub target_utilization_percent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AccelerationBenefit {
pub speed_improvement_factor: f64,
pub power_efficiency_improvement: f64,
pub cost_per_performance: f64,
pub description: String,
pub confidence_level: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AIUpgradeRecommendations {
pub memory_upgrade: Option<MemoryUpgrade>,
pub gpu_upgrade: Option<GPUUpgrade>,
pub accelerator_recommendation: Option<AcceleratorRecommendation>,
pub storage_recommendation: Option<StorageRecommendation>,
pub estimated_cost: Option<CostEstimate>,
pub performance_gain: Option<PerformanceGainEstimate>,
pub priority: UpgradePriority,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MemoryUpgrade {
pub current_ram_gb: f64,
pub recommended_ram_gb: f64,
pub description: String,
pub estimated_cost_usd: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GPUUpgrade {
pub current_gpu: String,
pub recommended_gpu: String,
pub vram_required_gb: f64,
pub vram_recommended_gb: f64,
pub description: String,
pub estimated_cost_usd: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AcceleratorRecommendation {
pub accelerator_name: String,
pub accelerator_type: String,
pub tops_performance: f64,
pub description: String,
pub estimated_cost_usd: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StorageRecommendation {
pub current_storage: String,
pub recommended_storage: String,
pub description: String,
pub estimated_cost_usd: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PerformanceGainEstimate {
pub latency_improvement_percent: f64,
pub throughput_improvement_percent: f64,
pub energy_efficiency_improvement_percent: f64,
pub description: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkloadRequirements {
pub name: String,
pub cpu_cores: usize,
pub memory_gb: f64,
pub storage_gb: f64,
pub network_bandwidth_mbps: Option<f64>,
pub cpu_architecture: Option<String>,
pub operating_system: Option<String>,
pub description: String,
pub workload: Option<crate::workloads::WorkloadType>,
pub resource_requirements: Vec<crate::resources::ResourceRequirement>,
pub priority: WorkloadPriority,
}
impl WorkloadRequirements {
pub fn new(name: &str) -> Self {
Self {
name: name.to_string(),
cpu_cores: 1,
memory_gb: 1.0,
storage_gb: 10.0,
network_bandwidth_mbps: None,
cpu_architecture: None,
operating_system: None,
description: String::new(),
workload: None,
resource_requirements: Vec::new(),
priority: WorkloadPriority::Medium,
}
}
pub fn add_resource_requirement(&mut self, requirement: crate::resources::ResourceRequirement) {
self.resource_requirements.push(requirement);
}
pub fn get_resource_requirement(&self, resource_type: &crate::resources::ResourceType) -> Option<&crate::resources::ResourceRequirement> {
self.resource_requirements.iter().find(|req| req.resource_type == *resource_type)
}
}
#[derive(Debug, Clone)]
pub struct SystemProfileBuilder {
cpu_score: f64,
gpu_score: f64,
npu_score: f64,
tpu_score: f64,
fpga_score: f64,
arm_optimization_score: f64,
memory_score: f64,
storage_score: f64,
network_score: f64,
system_info: Option<SystemInfo>,
}
impl SystemProfileBuilder {
pub fn new() -> Self {
Self {
cpu_score: 0.0,
gpu_score: 0.0,
npu_score: 0.0,
tpu_score: 0.0,
fpga_score: 0.0,
arm_optimization_score: 0.0,
memory_score: 0.0,
storage_score: 0.0,
network_score: 0.0,
system_info: None,
}
}
pub fn cpu_score(mut self, score: f64) -> Self {
self.cpu_score = score;
self
}
pub fn gpu_score(mut self, score: f64) -> Self {
self.gpu_score = score;
self
}
pub fn npu_score(mut self, score: f64) -> Self {
self.npu_score = score;
self
}
pub fn tpu_score(mut self, score: f64) -> Self {
self.tpu_score = score;
self
}
pub fn fpga_score(mut self, score: f64) -> Self {
self.fpga_score = score;
self
}
pub fn arm_optimization_score(mut self, score: f64) -> Self {
self.arm_optimization_score = score;
self
}
pub fn memory_score(mut self, score: f64) -> Self {
self.memory_score = score;
self
}
pub fn storage_score(mut self, score: f64) -> Self {
self.storage_score = score;
self
}
pub fn network_score(mut self, score: f64) -> Self {
self.network_score = score;
self
}
pub fn system_info(mut self, info: SystemInfo) -> Self {
self.system_info = Some(info);
self
}
pub fn build(self) -> SystemProfile {
let system_info = self.system_info.expect("SystemInfo is required");
let ai_accelerator_score = self.npu_score.max(self.tpu_score).max(self.fpga_score);
let ai_workload_score = ai_accelerator_score * 0.4 + self.gpu_score * 0.3 + self.cpu_score * 0.2 + self.memory_score * 0.1;
let edge_computing_score = self.arm_optimization_score * 0.3 + ai_accelerator_score * 0.3 + self.cpu_score * 0.2 + self.memory_score * 0.2;
let overall_score = (self.cpu_score + self.gpu_score + ai_accelerator_score + self.memory_score + self.storage_score + self.network_score) / 6.0;
SystemProfile {
cpu_score: self.cpu_score,
gpu_score: self.gpu_score,
npu_score: self.npu_score,
tpu_score: self.tpu_score,
fpga_score: self.fpga_score,
ai_accelerator_score,
arm_optimization_score: self.arm_optimization_score,
memory_score: self.memory_score,
storage_score: self.storage_score,
network_score: self.network_score,
overall_score,
ai_workload_score,
edge_computing_score,
system_info,
created_at: Utc::now(),
}
}
}
impl Default for SystemProfileBuilder {
fn default() -> Self {
Self::new()
}
}