feat: add summary dashboard history charts
This commit is contained in:
35
Sources/Model/History/MetricSample.swift
Normal file
35
Sources/Model/History/MetricSample.swift
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// MetricSample.swift
|
||||
// iKeyMon
|
||||
//
|
||||
// Created by tracer on 21.04.26.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftData
|
||||
|
||||
@Model
|
||||
final class MetricSample {
|
||||
var serverID: UUID
|
||||
var timestamp: Date
|
||||
var cpuPercent: Double
|
||||
var memoryPercent: Double
|
||||
var swapPercent: Double
|
||||
var diskPercent: Double
|
||||
|
||||
init(
|
||||
serverID: UUID,
|
||||
timestamp: Date = .now,
|
||||
cpuPercent: Double,
|
||||
memoryPercent: Double,
|
||||
swapPercent: Double,
|
||||
diskPercent: Double
|
||||
) {
|
||||
self.serverID = serverID
|
||||
self.timestamp = timestamp
|
||||
self.cpuPercent = cpuPercent
|
||||
self.memoryPercent = memoryPercent
|
||||
self.swapPercent = swapPercent
|
||||
self.diskPercent = diskPercent
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user