A lightweight performance monitoring library for Apple platforms that helps track various system metrics including CPU usage, memory consumption, FPS, network traffic, and system wakeups.
- 📊 CPU Usage Monitoring
- 🎯 FPS (Frames Per Second) Tracking
- 💾 Memory Usage Statistics
- 🌐 Network Traffic Analysis
- ⚡ System Wakeups Detection
- ⏱️ System Uptime Information
- iOS 13.0+ / tvOS 13.0+
- Swift 5.5+
- Xcode 13.0+
Add the following to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/iranqiu/Performance.git", from: "1.1.2")
]
import Performance
let performance = Performance()
Monitor CPU usage percentage:
if let cpuUsage = performance.cpuUsage {
print("CPU Usage: \(cpuUsage)%")
}
Monitor memory usage:
if let memoryUsage = performance.memoryUsage {
print("Memory Usage: \(memoryUsage) MB")
}
Monitor system wakeups:
if let interruptWakeups = performance.interruptWakeups {
print("Interrupt Wakeups: \(interruptWakeups)")
}
Monitor system uptime:
if let systemUptime = performance.systemUptime {
print("System Uptime: \(systemUptime) seconds")
}
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.