feat(memory): 增加内存分类历史趋势曲线
This commit is contained in:
@@ -235,8 +235,11 @@ struct MenuPanelView: View {
|
||||
value: snapshot.memory.map { String(format: "%.1f / %.0f GiB", Double($0.used) / 1_073_741_824, Double($0.total) / 1_073_741_824) } ?? "--") {
|
||||
PanelTrendChart(dates: samples.map(\.date),
|
||||
first: samples.map { $0.memory.map { $0 * Double(snapshot.memory?.total ?? 1) } },
|
||||
color: Color("MemoryApplication"), fixedScale: Double(snapshot.memory?.total ?? 1),
|
||||
second: samples.map(\.memoryApp), third: samples.map(\.memoryWired), fourth: samples.map(\.memoryCompressed),
|
||||
color: Color("MetricCPU"), secondColor: Color("MemoryApplication"),
|
||||
thirdColor: Color("MemoryWired"), fourthColor: Color("MemoryCompressed"), fixedScale: Double(snapshot.memory?.total ?? 1),
|
||||
scaleLabel: MetricFormat.memory(snapshot.memory?.total), firstValueFormat: .memory, firstLabel: "gpu.totalUtilization",
|
||||
secondLabel: "memory.app", thirdLabel: "memory.wired", fourthLabel: "memory.compressed",
|
||||
expectedInterval: chartInterval, boundaryDates: chartBoundaries, intervals: chartIntervals)
|
||||
if let memory = snapshot.memory {
|
||||
MemoryDetailsView(memory: memory)
|
||||
|
||||
Reference in New Issue
Block a user