Compare commits

..
Author SHA1 Message Date
gronod 3c9e209289 feat(telemetry): implement Intel and AMD GPU telemetry provider (fixes #14)
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:44:06 +01:00
gronod 6e07fad771 Merge branch 'feat/12-process-details' into milestone/m3-advanced-telemetry
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:42:02 +01:00
gronod a46f91f2ad feat(telemetry): implement per-process thread, file descriptor, and socket inspector (fixes #12)
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:41:56 +01:00
gronod 65468f6dfb Merge branch 'feat/11-process-explorer' into milestone/m3-advanced-telemetry
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:39:28 +01:00
gronod 72ed8256c8 feat(telemetry): implement live process explorer and resource attribution provider (fixes #11)
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:39:23 +01:00
gronod 4394c1e332 Merge branch 'feat/16-network-sockets' into milestone/m3-advanced-telemetry
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:37:34 +01:00
gronod 5b06749094 feat(telemetry): implement active network sockets and connection provider (fixes #16)
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:37:30 +01:00
gronod 0bc6c0a483 Merge branch 'feat/15-network-bandwidth' into milestone/m3-advanced-telemetry
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:35:53 +01:00
gronod 0aaa9d0110 feat(telemetry): implement real-time network bandwidth and interface throughput provider (fixes #15)
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:35:48 +01:00
gronod 54b6e6a7f8 Merge branch 'feat/10-disk-io' into milestone/m3-advanced-telemetry
MacMonitor CI/CD Pipeline / Build & Test (Intel x86_64) (push) Canceled after 0s
2026-09-08 12:34:29 +01:00
17 changed files with 1488 additions and 0 deletions
+120
View File
@@ -12,25 +12,41 @@
1879A3DCF6E305D7F2CD472E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2345555FF9780B02A90CC7A9 /* CoreFoundation.framework */; }; 1879A3DCF6E305D7F2CD472E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2345555FF9780B02A90CC7A9 /* CoreFoundation.framework */; };
1B15F48F6B19E9EA4556ECD5 /* MMStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78325870C7CD8312AECA2236 /* MMStorageTests.swift */; }; 1B15F48F6B19E9EA4556ECD5 /* MMStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78325870C7CD8312AECA2236 /* MMStorageTests.swift */; };
1B3F1C8ABF0ADFAA290FF6F6 /* MMSMCParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 375AA781A2AA0A20B119C7B7 /* MMSMCParser.m */; }; 1B3F1C8ABF0ADFAA290FF6F6 /* MMSMCParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 375AA781A2AA0A20B119C7B7 /* MMSMCParser.m */; };
2C0F7AB93691ED8AA86FBCF0 /* MMProcessDetailInspector.m in Sources */ = {isa = PBXBuildFile; fileRef = 52E641F8A664D456518EDBA4 /* MMProcessDetailInspector.m */; };
3BA6709B727B1AAC6C4310B5 /* MMProcessDetailsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7187632FF63B3B0D07FE9194 /* MMProcessDetailsTests.swift */; };
3C0AC14F803C813287D8A663 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007F48A5A599AB4E8D216D16 /* IOKit.framework */; }; 3C0AC14F803C813287D8A663 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007F48A5A599AB4E8D216D16 /* IOKit.framework */; };
4419FE7554489B23976E2970 /* MMCPULoadProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = D68FC8100D08DB6202F46339 /* MMCPULoadProvider.m */; }; 4419FE7554489B23976E2970 /* MMCPULoadProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = D68FC8100D08DB6202F46339 /* MMCPULoadProvider.m */; };
4C1A92F4DEF4C824976115C2 /* MMNetworkSocketsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374B1BF631CC4738CB52CA3B /* MMNetworkSocketsTests.swift */; };
57BA02AE1CE24DBD02BD03A4 /* MMComponentThermalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B288C7402E2C00E75F8CD016 /* MMComponentThermalTests.swift */; }; 57BA02AE1CE24DBD02BD03A4 /* MMComponentThermalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B288C7402E2C00E75F8CD016 /* MMComponentThermalTests.swift */; };
5D31906EA986E2BA92E86FA8 /* MMNetworkBandwidthTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C612287333D757C92A076A /* MMNetworkBandwidthTests.swift */; };
6201FD599FED061F6C736E8B /* MMMemoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099DCF7EF03A58ADA40A94A1 /* MMMemoryTests.swift */; }; 6201FD599FED061F6C736E8B /* MMMemoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099DCF7EF03A58ADA40A94A1 /* MMMemoryTests.swift */; };
655366D7066478A02EDA91BB /* MMFanTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = C9ED8F75E082D4F8AC2FF2F5 /* MMFanTelemetryProvider.m */; }; 655366D7066478A02EDA91BB /* MMFanTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = C9ED8F75E082D4F8AC2FF2F5 /* MMFanTelemetryProvider.m */; };
6A4FDB46AE5E0DAF85CCAB56 /* MMDiskIOTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9DAC4D5C09C974EE833DC7C /* MMDiskIOTests.swift */; };
6D973241BBE61F0B053239DB /* MMGPUTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = D61AB99733A4AA52459BA7C4 /* MMGPUTelemetryProvider.m */; };
7C9AE2ADAED52E593B52F3AE /* MMProcessTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52471E871E5CC1E444318070 /* MMProcessTests.swift */; };
87818E46CEA5145A8215D0E3 /* MMCPUThermalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BD3777A674DC4EB442890 /* MMCPUThermalTests.swift */; }; 87818E46CEA5145A8215D0E3 /* MMCPUThermalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BD3777A674DC4EB442890 /* MMCPUThermalTests.swift */; };
87A9E18362486D0D385BBC4A /* MMCPUThermalProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 62C377EFD025D6A6B5563E77 /* MMCPUThermalProvider.m */; }; 87A9E18362486D0D385BBC4A /* MMCPUThermalProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 62C377EFD025D6A6B5563E77 /* MMCPUThermalProvider.m */; };
88387CDAE2AC1CC74EF89B57 /* MacMonitorApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADEA6BD38BA8D887B1DB64A9 /* MacMonitorApp.swift */; }; 88387CDAE2AC1CC74EF89B57 /* MacMonitorApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADEA6BD38BA8D887B1DB64A9 /* MacMonitorApp.swift */; };
901EF4853E785A2856E54BC9 /* MMKernelTelemetryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE40072F9A1F9DBD1C48A3B1 /* MMKernelTelemetryTests.swift */; };
925245C5B5F8D8DA3C89C4BA /* MMComponentThermalProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = C65F5835516BC2A65BCE25D2 /* MMComponentThermalProvider.m */; }; 925245C5B5F8D8DA3C89C4BA /* MMComponentThermalProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = C65F5835516BC2A65BCE25D2 /* MMComponentThermalProvider.m */; };
93EF83FE087C6DEAAE3EC0CC /* MMProcessTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 728C692778909D2B7451C07B /* MMProcessTelemetryProvider.m */; };
951DBA5D3BBAB753322A5DF9 /* MMLoadAverageProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = B5F2256DF514DD737306302B /* MMLoadAverageProvider.m */; };
9B5C651AD2AF7DE2738F0C44 /* MMPowerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48698681374BD25B980C000 /* MMPowerTests.swift */; }; 9B5C651AD2AF7DE2738F0C44 /* MMPowerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48698681374BD25B980C000 /* MMPowerTests.swift */; };
9BCE74C5454F81EF80492E75 /* MacMonitorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC3EDFCD5C50CB352FCED87 /* MacMonitorTests.swift */; }; 9BCE74C5454F81EF80492E75 /* MacMonitorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC3EDFCD5C50CB352FCED87 /* MacMonitorTests.swift */; };
A521961E035DD50ED8B0C1A9 /* MMKernelTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = F444F4543F0A7421C8F8E636 /* MMKernelTelemetryProvider.m */; };
A599E974E56F0B8D94A7E480 /* MMNetworkSocketsProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = D78F76C1996D7FCA241CE532 /* MMNetworkSocketsProvider.m */; };
A7609CE56D49EC3419987468 /* SystemTelemetryStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B4E94FB2886C60D5548A2A /* SystemTelemetryStore.swift */; }; A7609CE56D49EC3419987468 /* SystemTelemetryStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B4E94FB2886C60D5548A2A /* SystemTelemetryStore.swift */; };
A9FCAEC0BF27A419DB148C4A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E142AE61F9B87757997870DD /* ContentView.swift */; }; A9FCAEC0BF27A419DB148C4A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E142AE61F9B87757997870DD /* ContentView.swift */; };
ACC914C61AB3762EB0C40513 /* MMLoadAverageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EB05C092C94C3972727AAA7 /* MMLoadAverageTests.swift */; };
AE3C28BDC3CEF40A9E8F2B20 /* MMGPUTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80A0F723121CDF9597316F58 /* MMGPUTests.swift */; };
B9C2D6574E808B517BA34C83 /* MMMemoryTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 991AEEAF262F3C6BE930BC77 /* MMMemoryTelemetryProvider.m */; }; B9C2D6574E808B517BA34C83 /* MMMemoryTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 991AEEAF262F3C6BE930BC77 /* MMMemoryTelemetryProvider.m */; };
CD91FC663B19DA1FEA3D49D7 /* MMAppleSMCClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5555436CD3CB8A73F5D6504F /* MMAppleSMCClient.m */; }; CD91FC663B19DA1FEA3D49D7 /* MMAppleSMCClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5555436CD3CB8A73F5D6504F /* MMAppleSMCClient.m */; };
E3CCE93A7D4D1EB0187D3E52 /* MMNetworkBandwidthProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = C539AEA27C794C6F428EA875 /* MMNetworkBandwidthProvider.m */; };
E6F2F695B8D3E7045967C082 /* MMFanTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 336CEE35A745F3C7E9F70F43 /* MMFanTests.swift */; }; E6F2F695B8D3E7045967C082 /* MMFanTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 336CEE35A745F3C7E9F70F43 /* MMFanTests.swift */; };
EAFAF5A10502D4ACC64F4720 /* MMTelemetryCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = F9F9AD1268F906761032AF4D /* MMTelemetryCoordinator.m */; }; EAFAF5A10502D4ACC64F4720 /* MMTelemetryCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = F9F9AD1268F906761032AF4D /* MMTelemetryCoordinator.m */; };
EC9FA3E4A119277B89E73F8D /* MMSMCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 940D608A1AF80F75584E744E /* MMSMCTests.swift */; }; EC9FA3E4A119277B89E73F8D /* MMSMCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 940D608A1AF80F75584E744E /* MMSMCTests.swift */; };
F2F7A141F2452EC1B4FB45D8 /* MMStorageTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DCBCEA450103E2404761B78 /* MMStorageTelemetryProvider.m */; }; F2F7A141F2452EC1B4FB45D8 /* MMStorageTelemetryProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DCBCEA450103E2404761B78 /* MMStorageTelemetryProvider.m */; };
FED88F290A2F2FBD63DDEC31 /* MMDiskIOProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E13917CAF525640D856ECD9 /* MMDiskIOProvider.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@@ -49,16 +65,26 @@
02F5FDE260999C39E978D849 /* MMPowerTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMPowerTelemetryProvider.m; sourceTree = "<group>"; }; 02F5FDE260999C39E978D849 /* MMPowerTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMPowerTelemetryProvider.m; sourceTree = "<group>"; };
09475741B5D0D4B89B863C3D /* MMComponentThermalProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMComponentThermalProvider.h; sourceTree = "<group>"; }; 09475741B5D0D4B89B863C3D /* MMComponentThermalProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMComponentThermalProvider.h; sourceTree = "<group>"; };
099DCF7EF03A58ADA40A94A1 /* MMMemoryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMMemoryTests.swift; sourceTree = "<group>"; }; 099DCF7EF03A58ADA40A94A1 /* MMMemoryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMMemoryTests.swift; sourceTree = "<group>"; };
0C94CCFBE8C9E1370368A28C /* MMNetworkSocketsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMNetworkSocketsProvider.h; sourceTree = "<group>"; };
0F2BD3777A674DC4EB442890 /* MMCPUThermalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMCPUThermalTests.swift; sourceTree = "<group>"; }; 0F2BD3777A674DC4EB442890 /* MMCPUThermalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMCPUThermalTests.swift; sourceTree = "<group>"; };
1AD9EEE571CD904BBCD1C96B /* MMSMCParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMSMCParser.h; sourceTree = "<group>"; }; 1AD9EEE571CD904BBCD1C96B /* MMSMCParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMSMCParser.h; sourceTree = "<group>"; };
1B07A683AD0EFBA8E1FB6C9D /* MMProcessDetailInspector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMProcessDetailInspector.h; sourceTree = "<group>"; };
2345555FF9780B02A90CC7A9 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 2345555FF9780B02A90CC7A9 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
27C612287333D757C92A076A /* MMNetworkBandwidthTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMNetworkBandwidthTests.swift; sourceTree = "<group>"; };
2C55E977DBFBE7FF04621608 /* MMLoadAverageProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMLoadAverageProvider.h; sourceTree = "<group>"; };
2EC3EDFCD5C50CB352FCED87 /* MacMonitorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacMonitorTests.swift; sourceTree = "<group>"; }; 2EC3EDFCD5C50CB352FCED87 /* MacMonitorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacMonitorTests.swift; sourceTree = "<group>"; };
32340166F6100A08105308D3 /* MMTelemetryCoordinator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMTelemetryCoordinator.h; sourceTree = "<group>"; }; 32340166F6100A08105308D3 /* MMTelemetryCoordinator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMTelemetryCoordinator.h; sourceTree = "<group>"; };
336CEE35A745F3C7E9F70F43 /* MMFanTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMFanTests.swift; sourceTree = "<group>"; }; 336CEE35A745F3C7E9F70F43 /* MMFanTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMFanTests.swift; sourceTree = "<group>"; };
374B1BF631CC4738CB52CA3B /* MMNetworkSocketsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMNetworkSocketsTests.swift; sourceTree = "<group>"; };
375AA781A2AA0A20B119C7B7 /* MMSMCParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMSMCParser.m; sourceTree = "<group>"; }; 375AA781A2AA0A20B119C7B7 /* MMSMCParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMSMCParser.m; sourceTree = "<group>"; };
3A14D7B97200EA4C102FEE67 /* MMNetworkBandwidthProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMNetworkBandwidthProvider.h; sourceTree = "<group>"; };
3CFC5B905E428A6B854E0AB4 /* MMFanTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMFanTelemetryProvider.h; sourceTree = "<group>"; }; 3CFC5B905E428A6B854E0AB4 /* MMFanTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMFanTelemetryProvider.h; sourceTree = "<group>"; };
3E13917CAF525640D856ECD9 /* MMDiskIOProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMDiskIOProvider.m; sourceTree = "<group>"; };
41478843A6B013478D94F739 /* MMProcessTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMProcessTelemetryProvider.h; sourceTree = "<group>"; };
46DE3AE12DAE26C4FE58034C /* MMStorageTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMStorageTelemetryProvider.h; sourceTree = "<group>"; }; 46DE3AE12DAE26C4FE58034C /* MMStorageTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMStorageTelemetryProvider.h; sourceTree = "<group>"; };
4CE92B1A8D7FDBB6499448E1 /* MMCPULoadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMCPULoadTests.swift; sourceTree = "<group>"; }; 4CE92B1A8D7FDBB6499448E1 /* MMCPULoadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMCPULoadTests.swift; sourceTree = "<group>"; };
52471E871E5CC1E444318070 /* MMProcessTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMProcessTests.swift; sourceTree = "<group>"; };
52E641F8A664D456518EDBA4 /* MMProcessDetailInspector.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMProcessDetailInspector.m; sourceTree = "<group>"; };
5555436CD3CB8A73F5D6504F /* MMAppleSMCClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMAppleSMCClient.m; sourceTree = "<group>"; }; 5555436CD3CB8A73F5D6504F /* MMAppleSMCClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMAppleSMCClient.m; sourceTree = "<group>"; };
5635101F862DE680856BDE6E /* MMTelemetryDomain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMTelemetryDomain.h; sourceTree = "<group>"; }; 5635101F862DE680856BDE6E /* MMTelemetryDomain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMTelemetryDomain.h; sourceTree = "<group>"; };
56E285A0A1746AE659981F22 /* MacMonitorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MacMonitorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56E285A0A1746AE659981F22 /* MacMonitorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MacMonitorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -66,21 +92,35 @@
62C377EFD025D6A6B5563E77 /* MMCPUThermalProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMCPUThermalProvider.m; sourceTree = "<group>"; }; 62C377EFD025D6A6B5563E77 /* MMCPUThermalProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMCPUThermalProvider.m; sourceTree = "<group>"; };
6D0E5CAF25DFA9A1D2A698A0 /* MMTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMTelemetryProvider.h; sourceTree = "<group>"; }; 6D0E5CAF25DFA9A1D2A698A0 /* MMTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMTelemetryProvider.h; sourceTree = "<group>"; };
6DCBCEA450103E2404761B78 /* MMStorageTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMStorageTelemetryProvider.m; sourceTree = "<group>"; }; 6DCBCEA450103E2404761B78 /* MMStorageTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMStorageTelemetryProvider.m; sourceTree = "<group>"; };
7187632FF63B3B0D07FE9194 /* MMProcessDetailsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMProcessDetailsTests.swift; sourceTree = "<group>"; };
726005CB5A6C86E7D80D3CA0 /* MMAppleSMCClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMAppleSMCClient.h; sourceTree = "<group>"; }; 726005CB5A6C86E7D80D3CA0 /* MMAppleSMCClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMAppleSMCClient.h; sourceTree = "<group>"; };
728C692778909D2B7451C07B /* MMProcessTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMProcessTelemetryProvider.m; sourceTree = "<group>"; };
78325870C7CD8312AECA2236 /* MMStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMStorageTests.swift; sourceTree = "<group>"; }; 78325870C7CD8312AECA2236 /* MMStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMStorageTests.swift; sourceTree = "<group>"; };
7EB05C092C94C3972727AAA7 /* MMLoadAverageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMLoadAverageTests.swift; sourceTree = "<group>"; };
80A0F723121CDF9597316F58 /* MMGPUTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMGPUTests.swift; sourceTree = "<group>"; };
8FBB436F3D9472194D8C6EDD /* MMSMCDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMSMCDefines.h; sourceTree = "<group>"; }; 8FBB436F3D9472194D8C6EDD /* MMSMCDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMSMCDefines.h; sourceTree = "<group>"; };
940D608A1AF80F75584E744E /* MMSMCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMSMCTests.swift; sourceTree = "<group>"; }; 940D608A1AF80F75584E744E /* MMSMCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMSMCTests.swift; sourceTree = "<group>"; };
991AEEAF262F3C6BE930BC77 /* MMMemoryTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMMemoryTelemetryProvider.m; sourceTree = "<group>"; }; 991AEEAF262F3C6BE930BC77 /* MMMemoryTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMMemoryTelemetryProvider.m; sourceTree = "<group>"; };
9DC54CCE276F93D5AF0A0C28 /* MMGPUTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMGPUTelemetryProvider.h; sourceTree = "<group>"; };
ADEA6BD38BA8D887B1DB64A9 /* MacMonitorApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacMonitorApp.swift; sourceTree = "<group>"; }; ADEA6BD38BA8D887B1DB64A9 /* MacMonitorApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacMonitorApp.swift; sourceTree = "<group>"; };
AFA681E2464EA78CC19B54E0 /* MMDiskIOProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMDiskIOProvider.h; sourceTree = "<group>"; };
B288C7402E2C00E75F8CD016 /* MMComponentThermalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMComponentThermalTests.swift; sourceTree = "<group>"; }; B288C7402E2C00E75F8CD016 /* MMComponentThermalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMComponentThermalTests.swift; sourceTree = "<group>"; };
B5F2256DF514DD737306302B /* MMLoadAverageProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMLoadAverageProvider.m; sourceTree = "<group>"; };
C539AEA27C794C6F428EA875 /* MMNetworkBandwidthProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMNetworkBandwidthProvider.m; sourceTree = "<group>"; };
C65F5835516BC2A65BCE25D2 /* MMComponentThermalProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMComponentThermalProvider.m; sourceTree = "<group>"; }; C65F5835516BC2A65BCE25D2 /* MMComponentThermalProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMComponentThermalProvider.m; sourceTree = "<group>"; };
C9ED8F75E082D4F8AC2FF2F5 /* MMFanTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMFanTelemetryProvider.m; sourceTree = "<group>"; }; C9ED8F75E082D4F8AC2FF2F5 /* MMFanTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMFanTelemetryProvider.m; sourceTree = "<group>"; };
CBA91906CA8B7936CC82A36B /* MMPowerTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMPowerTelemetryProvider.h; sourceTree = "<group>"; }; CBA91906CA8B7936CC82A36B /* MMPowerTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMPowerTelemetryProvider.h; sourceTree = "<group>"; };
D48698681374BD25B980C000 /* MMPowerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMPowerTests.swift; sourceTree = "<group>"; }; D48698681374BD25B980C000 /* MMPowerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMPowerTests.swift; sourceTree = "<group>"; };
D61AB99733A4AA52459BA7C4 /* MMGPUTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMGPUTelemetryProvider.m; sourceTree = "<group>"; };
D68FC8100D08DB6202F46339 /* MMCPULoadProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMCPULoadProvider.m; sourceTree = "<group>"; }; D68FC8100D08DB6202F46339 /* MMCPULoadProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMCPULoadProvider.m; sourceTree = "<group>"; };
D73CCC7B5E6BF1825EA68E2B /* MMCPUThermalProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMCPUThermalProvider.h; sourceTree = "<group>"; }; D73CCC7B5E6BF1825EA68E2B /* MMCPUThermalProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMCPUThermalProvider.h; sourceTree = "<group>"; };
D78F76C1996D7FCA241CE532 /* MMNetworkSocketsProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMNetworkSocketsProvider.m; sourceTree = "<group>"; };
DE40072F9A1F9DBD1C48A3B1 /* MMKernelTelemetryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMKernelTelemetryTests.swift; sourceTree = "<group>"; };
E142AE61F9B87757997870DD /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; }; E142AE61F9B87757997870DD /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
E4B4E94FB2886C60D5548A2A /* SystemTelemetryStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemTelemetryStore.swift; sourceTree = "<group>"; }; E4B4E94FB2886C60D5548A2A /* SystemTelemetryStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemTelemetryStore.swift; sourceTree = "<group>"; };
E6D9BB71DFE7384D0F0E6AA3 /* MMKernelTelemetryProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMKernelTelemetryProvider.h; sourceTree = "<group>"; };
E9DAC4D5C09C974EE833DC7C /* MMDiskIOTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MMDiskIOTests.swift; sourceTree = "<group>"; };
F444F4543F0A7421C8F8E636 /* MMKernelTelemetryProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMKernelTelemetryProvider.m; sourceTree = "<group>"; };
F5EC59DCDA5FABDA409CDBCB /* MacMonitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacMonitor.app; sourceTree = BUILT_PRODUCTS_DIR; }; F5EC59DCDA5FABDA409CDBCB /* MacMonitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacMonitor.app; sourceTree = BUILT_PRODUCTS_DIR; };
F9F9AD1268F906761032AF4D /* MMTelemetryCoordinator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMTelemetryCoordinator.m; sourceTree = "<group>"; }; F9F9AD1268F906761032AF4D /* MMTelemetryCoordinator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMTelemetryCoordinator.m; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@@ -157,6 +197,17 @@
path = CPU; path = CPU;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
8719744C366432DD7C2B9644 /* Process */ = {
isa = PBXGroup;
children = (
1B07A683AD0EFBA8E1FB6C9D /* MMProcessDetailInspector.h */,
52E641F8A664D456518EDBA4 /* MMProcessDetailInspector.m */,
41478843A6B013478D94F739 /* MMProcessTelemetryProvider.h */,
728C692778909D2B7451C07B /* MMProcessTelemetryProvider.m */,
);
path = Process;
sourceTree = "<group>";
};
8B31CE7F9319FEC373E6CDC6 /* Power */ = { 8B31CE7F9319FEC373E6CDC6 /* Power */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -171,14 +222,30 @@
children = ( children = (
78383CED205BCA772701AE48 /* CPU */, 78383CED205BCA772701AE48 /* CPU */,
AD2995435E44FA3E1790A4F3 /* Fan */, AD2995435E44FA3E1790A4F3 /* Fan */,
F99AF003017BA9F19F7AEB1E /* GPU */,
CA2F30473D63EC64CBD65437 /* Kernel */,
EE2F5EFC9DC33CEDA79A131F /* Memory */, EE2F5EFC9DC33CEDA79A131F /* Memory */,
901D54FEAB6E9D6E787E599D /* Network */,
8B31CE7F9319FEC373E6CDC6 /* Power */, 8B31CE7F9319FEC373E6CDC6 /* Power */,
8719744C366432DD7C2B9644 /* Process */,
B6EB3F6545276C40212C2992 /* Storage */, B6EB3F6545276C40212C2992 /* Storage */,
A8658D19E71E34F1DDD87097 /* System */,
DBDC37231C01F0A2D4A7FC73 /* Thermal */, DBDC37231C01F0A2D4A7FC73 /* Thermal */,
); );
path = Telemetry; path = Telemetry;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
901D54FEAB6E9D6E787E599D /* Network */ = {
isa = PBXGroup;
children = (
3A14D7B97200EA4C102FEE67 /* MMNetworkBandwidthProvider.h */,
C539AEA27C794C6F428EA875 /* MMNetworkBandwidthProvider.m */,
0C94CCFBE8C9E1370368A28C /* MMNetworkSocketsProvider.h */,
D78F76C1996D7FCA241CE532 /* MMNetworkSocketsProvider.m */,
);
path = Network;
sourceTree = "<group>";
};
9844EC526E3527F6A582179F /* Hardware */ = { 9844EC526E3527F6A582179F /* Hardware */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -187,6 +254,15 @@
path = Hardware; path = Hardware;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A8658D19E71E34F1DDD87097 /* System */ = {
isa = PBXGroup;
children = (
2C55E977DBFBE7FF04621608 /* MMLoadAverageProvider.h */,
B5F2256DF514DD737306302B /* MMLoadAverageProvider.m */,
);
path = System;
sourceTree = "<group>";
};
AD2995435E44FA3E1790A4F3 /* Fan */ = { AD2995435E44FA3E1790A4F3 /* Fan */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -199,6 +275,8 @@
B6EB3F6545276C40212C2992 /* Storage */ = { B6EB3F6545276C40212C2992 /* Storage */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
AFA681E2464EA78CC19B54E0 /* MMDiskIOProvider.h */,
3E13917CAF525640D856ECD9 /* MMDiskIOProvider.m */,
46DE3AE12DAE26C4FE58034C /* MMStorageTelemetryProvider.h */, 46DE3AE12DAE26C4FE58034C /* MMStorageTelemetryProvider.h */,
6DCBCEA450103E2404761B78 /* MMStorageTelemetryProvider.m */, 6DCBCEA450103E2404761B78 /* MMStorageTelemetryProvider.m */,
); );
@@ -221,15 +299,32 @@
B288C7402E2C00E75F8CD016 /* MMComponentThermalTests.swift */, B288C7402E2C00E75F8CD016 /* MMComponentThermalTests.swift */,
4CE92B1A8D7FDBB6499448E1 /* MMCPULoadTests.swift */, 4CE92B1A8D7FDBB6499448E1 /* MMCPULoadTests.swift */,
0F2BD3777A674DC4EB442890 /* MMCPUThermalTests.swift */, 0F2BD3777A674DC4EB442890 /* MMCPUThermalTests.swift */,
E9DAC4D5C09C974EE833DC7C /* MMDiskIOTests.swift */,
336CEE35A745F3C7E9F70F43 /* MMFanTests.swift */, 336CEE35A745F3C7E9F70F43 /* MMFanTests.swift */,
80A0F723121CDF9597316F58 /* MMGPUTests.swift */,
DE40072F9A1F9DBD1C48A3B1 /* MMKernelTelemetryTests.swift */,
7EB05C092C94C3972727AAA7 /* MMLoadAverageTests.swift */,
099DCF7EF03A58ADA40A94A1 /* MMMemoryTests.swift */, 099DCF7EF03A58ADA40A94A1 /* MMMemoryTests.swift */,
27C612287333D757C92A076A /* MMNetworkBandwidthTests.swift */,
374B1BF631CC4738CB52CA3B /* MMNetworkSocketsTests.swift */,
D48698681374BD25B980C000 /* MMPowerTests.swift */, D48698681374BD25B980C000 /* MMPowerTests.swift */,
7187632FF63B3B0D07FE9194 /* MMProcessDetailsTests.swift */,
52471E871E5CC1E444318070 /* MMProcessTests.swift */,
940D608A1AF80F75584E744E /* MMSMCTests.swift */, 940D608A1AF80F75584E744E /* MMSMCTests.swift */,
78325870C7CD8312AECA2236 /* MMStorageTests.swift */, 78325870C7CD8312AECA2236 /* MMStorageTests.swift */,
); );
path = Tests; path = Tests;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
CA2F30473D63EC64CBD65437 /* Kernel */ = {
isa = PBXGroup;
children = (
E6D9BB71DFE7384D0F0E6AA3 /* MMKernelTelemetryProvider.h */,
F444F4543F0A7421C8F8E636 /* MMKernelTelemetryProvider.m */,
);
path = Kernel;
sourceTree = "<group>";
};
DBDC37231C01F0A2D4A7FC73 /* Thermal */ = { DBDC37231C01F0A2D4A7FC73 /* Thermal */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -271,6 +366,15 @@
path = Memory; path = Memory;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
F99AF003017BA9F19F7AEB1E /* GPU */ = {
isa = PBXGroup;
children = (
9DC54CCE276F93D5AF0A0C28 /* MMGPUTelemetryProvider.h */,
D61AB99733A4AA52459BA7C4 /* MMGPUTelemetryProvider.m */,
);
path = GPU;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@@ -349,9 +453,17 @@
160334CC765E091A7CBE21AA /* MMCPULoadTests.swift in Sources */, 160334CC765E091A7CBE21AA /* MMCPULoadTests.swift in Sources */,
87818E46CEA5145A8215D0E3 /* MMCPUThermalTests.swift in Sources */, 87818E46CEA5145A8215D0E3 /* MMCPUThermalTests.swift in Sources */,
57BA02AE1CE24DBD02BD03A4 /* MMComponentThermalTests.swift in Sources */, 57BA02AE1CE24DBD02BD03A4 /* MMComponentThermalTests.swift in Sources */,
6A4FDB46AE5E0DAF85CCAB56 /* MMDiskIOTests.swift in Sources */,
E6F2F695B8D3E7045967C082 /* MMFanTests.swift in Sources */, E6F2F695B8D3E7045967C082 /* MMFanTests.swift in Sources */,
AE3C28BDC3CEF40A9E8F2B20 /* MMGPUTests.swift in Sources */,
901EF4853E785A2856E54BC9 /* MMKernelTelemetryTests.swift in Sources */,
ACC914C61AB3762EB0C40513 /* MMLoadAverageTests.swift in Sources */,
6201FD599FED061F6C736E8B /* MMMemoryTests.swift in Sources */, 6201FD599FED061F6C736E8B /* MMMemoryTests.swift in Sources */,
5D31906EA986E2BA92E86FA8 /* MMNetworkBandwidthTests.swift in Sources */,
4C1A92F4DEF4C824976115C2 /* MMNetworkSocketsTests.swift in Sources */,
9B5C651AD2AF7DE2738F0C44 /* MMPowerTests.swift in Sources */, 9B5C651AD2AF7DE2738F0C44 /* MMPowerTests.swift in Sources */,
3BA6709B727B1AAC6C4310B5 /* MMProcessDetailsTests.swift in Sources */,
7C9AE2ADAED52E593B52F3AE /* MMProcessTests.swift in Sources */,
EC9FA3E4A119277B89E73F8D /* MMSMCTests.swift in Sources */, EC9FA3E4A119277B89E73F8D /* MMSMCTests.swift in Sources */,
1B15F48F6B19E9EA4556ECD5 /* MMStorageTests.swift in Sources */, 1B15F48F6B19E9EA4556ECD5 /* MMStorageTests.swift in Sources */,
9BCE74C5454F81EF80492E75 /* MacMonitorTests.swift in Sources */, 9BCE74C5454F81EF80492E75 /* MacMonitorTests.swift in Sources */,
@@ -367,9 +479,17 @@
4419FE7554489B23976E2970 /* MMCPULoadProvider.m in Sources */, 4419FE7554489B23976E2970 /* MMCPULoadProvider.m in Sources */,
87A9E18362486D0D385BBC4A /* MMCPUThermalProvider.m in Sources */, 87A9E18362486D0D385BBC4A /* MMCPUThermalProvider.m in Sources */,
925245C5B5F8D8DA3C89C4BA /* MMComponentThermalProvider.m in Sources */, 925245C5B5F8D8DA3C89C4BA /* MMComponentThermalProvider.m in Sources */,
FED88F290A2F2FBD63DDEC31 /* MMDiskIOProvider.m in Sources */,
655366D7066478A02EDA91BB /* MMFanTelemetryProvider.m in Sources */, 655366D7066478A02EDA91BB /* MMFanTelemetryProvider.m in Sources */,
6D973241BBE61F0B053239DB /* MMGPUTelemetryProvider.m in Sources */,
A521961E035DD50ED8B0C1A9 /* MMKernelTelemetryProvider.m in Sources */,
951DBA5D3BBAB753322A5DF9 /* MMLoadAverageProvider.m in Sources */,
B9C2D6574E808B517BA34C83 /* MMMemoryTelemetryProvider.m in Sources */, B9C2D6574E808B517BA34C83 /* MMMemoryTelemetryProvider.m in Sources */,
E3CCE93A7D4D1EB0187D3E52 /* MMNetworkBandwidthProvider.m in Sources */,
A599E974E56F0B8D94A7E480 /* MMNetworkSocketsProvider.m in Sources */,
0A7117B3B7CC7112F2527574 /* MMPowerTelemetryProvider.m in Sources */, 0A7117B3B7CC7112F2527574 /* MMPowerTelemetryProvider.m in Sources */,
2C0F7AB93691ED8AA86FBCF0 /* MMProcessDetailInspector.m in Sources */,
93EF83FE087C6DEAAE3EC0CC /* MMProcessTelemetryProvider.m in Sources */,
1B3F1C8ABF0ADFAA290FF6F6 /* MMSMCParser.m in Sources */, 1B3F1C8ABF0ADFAA290FF6F6 /* MMSMCParser.m in Sources */,
F2F7A141F2452EC1B4FB45D8 /* MMStorageTelemetryProvider.m in Sources */, F2F7A141F2452EC1B4FB45D8 /* MMStorageTelemetryProvider.m in Sources */,
EAFAF5A10502D4ACC64F4720 /* MMTelemetryCoordinator.m in Sources */, EAFAF5A10502D4ACC64F4720 /* MMTelemetryCoordinator.m in Sources */,
@@ -22,5 +22,10 @@
#import "MMKernelTelemetryProvider.h" #import "MMKernelTelemetryProvider.h"
#import "MMLoadAverageProvider.h" #import "MMLoadAverageProvider.h"
#import "MMDiskIOProvider.h" #import "MMDiskIOProvider.h"
#import "MMNetworkBandwidthProvider.h"
#import "MMNetworkSocketsProvider.h"
#import "MMProcessTelemetryProvider.h"
#import "MMProcessDetailInspector.h"
#import "MMGPUTelemetryProvider.h"
#endif /* MacMonitor_Bridging_Header_h */ #endif /* MacMonitor_Bridging_Header_h */
@@ -0,0 +1,31 @@
#ifndef MMGPUTelemetryProvider_h
#define MMGPUTelemetryProvider_h
#import <Foundation/Foundation.h>
#import "MMTelemetryProvider.h"
#import "MMAppleSMCClient.h"
NS_ASSUME_NONNULL_BEGIN
/**
* MMGPUTelemetryProvider
* Samples Intel Integrated Graphics (Iris/UHD) and AMD Discrete Graphics (Radeon/Vega)
* utilization, VRAM allocation, and thermal metrics via IOKit and Metal.
*/
@interface MMGPUTelemetryProvider : NSObject <MMTelemetryProvider>
@property (nonatomic, strong, readonly) MMAppleSMCClient *smcClient;
- (instancetype)init;
- (instancetype)initWithSMCClient:(MMAppleSMCClient *)client;
/**
* Pure calculator method for deterministic unit testing.
*/
+ (NSDictionary<NSString *, id> *)calculateGPUMetricsWithDevices:(NSArray<NSDictionary<NSString *, id> *> *)gpuDevices;
@end
NS_ASSUME_NONNULL_END
#endif /* MMGPUTelemetryProvider_h */
@@ -0,0 +1,184 @@
#import "MMGPUTelemetryProvider.h"
#import <IOKit/IOKitLib.h>
#import <Metal/Metal.h>
@interface MMGPUTelemetryProvider () {
MMAppleSMCClient *_smcClient;
}
@end
@implementation MMGPUTelemetryProvider
- (instancetype)init {
return [self initWithSMCClient:[MMAppleSMCClient sharedClient]];
}
- (instancetype)initWithSMCClient:(MMAppleSMCClient *)client {
self = [super init];
if (self) {
_smcClient = client;
}
return self;
}
- (MMTelemetryDomain)domain {
return MMTelemetryDomainGPU;
}
- (NSString *)providerIdentifier {
return @"com.i3omb.macmonitor.telemetry.gpu";
}
- (BOOL)isAvailable {
return YES;
}
- (MMAppleSMCClient *)smcClient {
return _smcClient;
}
+ (NSDictionary<NSString *, id> *)calculateGPUMetricsWithDevices:(NSArray<NSDictionary<NSString *, id> *> *)gpuDevices {
double totalUtil = 0.0;
double peakUtil = 0.0;
NSString *activeGPU = @"None";
for (NSDictionary<NSString *, id> *gpu in gpuDevices) {
double util = [gpu[@"utilization"] doubleValue];
totalUtil += util;
if (util > peakUtil) {
peakUtil = util;
activeGPU = gpu[@"name"] ?: @"GPU";
}
}
double avgUtil = gpuDevices.count > 0 ? (totalUtil / (double)gpuDevices.count) : 0.0;
if ([activeGPU isEqualToString:@"None"] && gpuDevices.count > 0) {
activeGPU = gpuDevices[0][@"name"] ?: @"GPU";
}
return @{
@"gpuCount": @(gpuDevices.count),
@"averageUtilization": @(avgUtil),
@"peakUtilization": @(peakUtil),
@"activeGPUName": activeGPU,
@"devices": gpuDevices
};
}
- (nullable NSDictionary<NSString *, id> *)sampleTelemetryWithError:(NSError **)error {
// 1. Query IOKit IOAccelerator performance statistics
NSMutableDictionary<NSString *, NSDictionary *> *accelStatsByName = [NSMutableDictionary dictionary];
CFMutableDictionaryRef matching = IOServiceMatching("IOAccelerator");
io_iterator_t iterator = IO_OBJECT_NULL;
if (IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iterator) == KERN_SUCCESS && iterator != IO_OBJECT_NULL) {
io_registry_entry_t entry;
while ((entry = IOIteratorNext(iterator)) != IO_OBJECT_NULL) {
CFMutableDictionaryRef props = NULL;
if (IORegistryEntryCreateCFProperties(entry, &props, kCFAllocatorDefault, 0) == KERN_SUCCESS && props) {
NSDictionary *dict = (__bridge NSDictionary *)props;
NSDictionary *stats = dict[@"PerformanceStatistics"];
io_name_t entryName;
if (IORegistryEntryGetName(entry, entryName) == KERN_SUCCESS && stats) {
accelStatsByName[[NSString stringWithUTF8String:entryName]] = stats;
}
CFRelease(props);
}
IOObjectRelease(entry);
}
IOObjectRelease(iterator);
}
// 2. Query SMC for GPU temperature fallback
NSNumber *smcGpuTemp = nil;
if (_smcClient.isAvailable) {
smcGpuTemp = [_smcClient readNumericValueForKey:@"TG0D" error:nil];
if (!smcGpuTemp) {
smcGpuTemp = [_smcClient readNumericValueForKey:@"TG0P" error:nil];
}
}
// 3. Enumerate Metal devices
NSArray<id<MTLDevice>> *metalDevices = MTLCopyAllDevices();
NSMutableArray<NSDictionary<NSString *, id> *> *deviceList = [NSMutableArray array];
for (id<MTLDevice> dev in metalDevices) {
NSString *name = dev.name;
BOOL isLowPower = dev.isLowPower;
BOOL isRemovable = dev.isRemovable;
uint64_t maxMem = dev.recommendedMaxWorkingSetSize;
// Find matching stats
double util = 0.0;
uint64_t vramUsed = 0;
uint64_t vramTotal = maxMem;
double temp = smcGpuTemp ? [smcGpuTemp doubleValue] : 0.0;
for (NSString *accelName in accelStatsByName) {
NSDictionary *stats = accelStatsByName[accelName];
// Check Intel stats
if ([name containsString:@"Intel"] || [accelName containsString:@"Intel"]) {
if (stats[@"Device Utilization %"]) {
util = [stats[@"Device Utilization %"] doubleValue];
}
if (stats[@"gartUsedBytes"]) {
vramUsed = [stats[@"gartUsedBytes"] unsignedLongLongValue];
}
if (stats[@"gartSizeBytes"]) {
vramTotal = [stats[@"gartSizeBytes"] unsignedLongLongValue];
}
} else {
// AMD / Discrete stats
if (stats[@"GPU Activity(%)"]) {
util = [stats[@"GPU Activity(%)"] doubleValue];
} else if (stats[@"Device Utilization %"]) {
util = [stats[@"Device Utilization %"] doubleValue];
}
if (stats[@"vramUsedBytes"]) {
vramUsed = [stats[@"vramUsedBytes"] unsignedLongLongValue];
}
if (stats[@"vramFreeBytes"]) {
uint64_t freeBytes = [stats[@"vramFreeBytes"] unsignedLongLongValue];
vramTotal = vramUsed + freeBytes;
}
if (stats[@"Temperature(C)"]) {
temp = [stats[@"Temperature(C)"] doubleValue];
}
}
}
NSString *gpuType = isLowPower || [name containsString:@"Intel"] ? @"Integrated" : @"Discrete";
[deviceList addObject:@{
@"name": name,
@"type": gpuType,
@"utilization": @(util),
@"vramUsedBytes": @(vramUsed),
@"vramTotalBytes": @(vramTotal),
@"temperature": @(temp),
@"isLowPower": @(isLowPower),
@"isRemovable": @(isRemovable),
@"recommendedMaxWorkingSetBytes": @(maxMem)
}];
}
// Fallback if no Metal devices enumerated (headless / virtualization)
if (deviceList.count == 0) {
[deviceList addObject:@{
@"name": @"Default GPU",
@"type": @"Integrated",
@"utilization": @(0.0),
@"vramUsedBytes": @(0),
@"vramTotalBytes": @(1024 * 1024 * 1024),
@"temperature": @(0.0),
@"isLowPower": @(YES),
@"isRemovable": @(NO),
@"recommendedMaxWorkingSetBytes": @(1024 * 1024 * 1024)
}];
}
return [MMGPUTelemetryProvider calculateGPUMetricsWithDevices:deviceList];
}
@end
@@ -0,0 +1,30 @@
#ifndef MMNetworkBandwidthProvider_h
#define MMNetworkBandwidthProvider_h
#import <Foundation/Foundation.h>
#import "MMTelemetryProvider.h"
NS_ASSUME_NONNULL_BEGIN
/**
* MMNetworkBandwidthProvider
* Samples real-time network download and upload throughput, packets/sec, and error counts
* across physical (Wi-Fi, Ethernet) and virtual (VPN, bridge) network interfaces.
*/
@interface MMNetworkBandwidthProvider : NSObject <MMTelemetryProvider>
- (instancetype)init;
/**
* Pure calculator method for deterministic unit testing.
*/
+ (NSDictionary<NSString *, id> *)calculateBandwidthMetricsWithCurrentSnapshots:(NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *)current
previousSnapshots:(nullable NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *)previous
timeDelta:(NSTimeInterval)timeDelta
ipAddresses:(nullable NSDictionary<NSString *, NSString *> *)ipAddresses;
@end
NS_ASSUME_NONNULL_END
#endif /* MMNetworkBandwidthProvider_h */
@@ -0,0 +1,211 @@
#import "MMNetworkBandwidthProvider.h"
#import <sys/sysctl.h>
#import <net/if.h>
#import <net/if_dl.h>
#import <net/route.h>
#import <ifaddrs.h>
#import <arpa/inet.h>
#import <mach/mach_time.h>
#import <os/lock.h>
@interface MMNetworkBandwidthProvider () {
os_unfair_lock _lock;
NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *_previousSnapshots;
uint64_t _previousTimestamp;
mach_timebase_info_data_t _timebase;
}
@end
@implementation MMNetworkBandwidthProvider
- (instancetype)init {
self = [super init];
if (self) {
_lock = OS_UNFAIR_LOCK_INIT;
_previousSnapshots = nil;
_previousTimestamp = 0;
mach_timebase_info(&_timebase);
}
return self;
}
- (MMTelemetryDomain)domain {
return MMTelemetryDomainNetwork;
}
- (NSString *)providerIdentifier {
return @"com.i3omb.macmonitor.telemetry.network.bandwidth";
}
- (BOOL)isAvailable {
return YES;
}
+ (NSDictionary<NSString *, id> *)calculateBandwidthMetricsWithCurrentSnapshots:(NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *)current
previousSnapshots:(nullable NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *)previous
timeDelta:(NSTimeInterval)timeDelta
ipAddresses:(nullable NSDictionary<NSString *, NSString *> *)ipAddresses {
double totalDownBps = 0.0;
double totalUpBps = 0.0;
double totalDownPps = 0.0;
double totalUpPps = 0.0;
NSMutableArray<NSDictionary<NSString *, id> *> *interfaces = [NSMutableArray arrayWithCapacity:current.count];
NSArray<NSString *> *sortedNames = [current.allKeys sortedArrayUsingSelector:@selector(compare:)];
NSString *primaryInterface = @"";
double maxActivity = -1.0;
for (NSString *name in sortedNames) {
// Skip loopback for aggregate statistics
BOOL isLoopback = [name hasPrefix:@"lo"];
NSDictionary<NSString *, NSNumber *> *curr = current[name];
NSDictionary<NSString *, NSNumber *> *prev = previous ? previous[name] : nil;
uint64_t currInBytes = [curr[@"inBytes"] unsignedLongLongValue];
uint64_t currOutBytes = [curr[@"outBytes"] unsignedLongLongValue];
uint64_t currInPackets = [curr[@"inPackets"] unsignedLongLongValue];
uint64_t currOutPackets = [curr[@"outPackets"] unsignedLongLongValue];
uint64_t inErrors = [curr[@"inErrors"] unsignedLongLongValue];
uint64_t outErrors = [curr[@"outErrors"] unsignedLongLongValue];
uint64_t prevInBytes = prev ? [prev[@"inBytes"] unsignedLongLongValue] : currInBytes;
uint64_t prevOutBytes = prev ? [prev[@"outBytes"] unsignedLongLongValue] : currOutBytes;
uint64_t prevInPackets = prev ? [prev[@"inPackets"] unsignedLongLongValue] : currInPackets;
uint64_t prevOutPackets = prev ? [prev[@"outPackets"] unsignedLongLongValue] : currOutPackets;
double deltaInBytes = (currInBytes >= prevInBytes) ? (double)(currInBytes - prevInBytes) : 0.0;
double deltaOutBytes = (currOutBytes >= prevOutBytes) ? (double)(currOutBytes - prevOutBytes) : 0.0;
double deltaInPackets = (currInPackets >= prevInPackets) ? (double)(currInPackets - prevInPackets) : 0.0;
double deltaOutPackets = (currOutPackets >= prevOutPackets) ? (double)(currOutPackets - prevOutPackets) : 0.0;
double downBps = (timeDelta > 0.0001) ? (deltaInBytes / timeDelta) : 0.0;
double upBps = (timeDelta > 0.0001) ? (deltaOutBytes / timeDelta) : 0.0;
double downPps = (timeDelta > 0.0001) ? (deltaInPackets / timeDelta) : 0.0;
double upPps = (timeDelta > 0.0001) ? (deltaOutPackets / timeDelta) : 0.0;
if (!isLoopback) {
totalDownBps += downBps;
totalUpBps += upBps;
totalDownPps += downPps;
totalUpPps += upPps;
double activity = downBps + upBps;
if (activity > maxActivity) {
maxActivity = activity;
primaryInterface = name;
}
}
NSString *ip = ipAddresses[name] ?: @"";
[interfaces addObject:@{
@"name": name,
@"downloadBytesPerSec": @(downBps),
@"uploadBytesPerSec": @(upBps),
@"downloadPacketsPerSec": @(downPps),
@"uploadPacketsPerSec": @(upPps),
@"cumulativeInBytes": @(currInBytes),
@"cumulativeOutBytes": @(currOutBytes),
@"cumulativeInPackets": @(currInPackets),
@"cumulativeOutPackets": @(currOutPackets),
@"inErrors": @(inErrors),
@"outErrors": @(outErrors),
@"ipv4Address": ip,
@"isLoopback": @(isLoopback)
}];
}
if (primaryInterface.length == 0 && current[@"en0"]) {
primaryInterface = @"en0";
}
return @{
@"interfaces": interfaces,
@"totalDownloadBytesPerSec": @(totalDownBps),
@"totalUploadBytesPerSec": @(totalUpBps),
@"totalDownloadPacketsPerSec": @(totalDownPps),
@"totalUploadPacketsPerSec": @(totalUpPps),
@"primaryInterface": primaryInterface,
@"timeDelta": @(timeDelta)
};
}
- (nullable NSDictionary<NSString *, id> *)sampleTelemetryWithError:(NSError **)error {
uint64_t now = mach_absolute_time();
// 1. Read 64-bit interface stats via NET_RT_IFLIST2
NSMutableDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *currentSnapshots = [NSMutableDictionary dictionary];
int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST2, 0 };
size_t len = 0;
if (sysctl(mib, 6, NULL, &len, NULL, 0) == 0 && len > 0) {
char *buf = malloc(len);
if (buf && sysctl(mib, 6, buf, &len, NULL, 0) == 0) {
char *next = buf;
char *lim = buf + len;
while (next < lim) {
struct if_msghdr *ifm = (struct if_msghdr *)next;
next += ifm->ifm_msglen;
if (ifm->ifm_type == RTM_IFINFO2) {
struct if_msghdr2 *if2m = (struct if_msghdr2 *)ifm;
struct sockaddr_dl *sdl = (struct sockaddr_dl *)(if2m + 1);
if (sdl->sdl_nlen > 0 && sdl->sdl_nlen < 32) {
char nameBuf[33] = {0};
memcpy(nameBuf, sdl->sdl_data, sdl->sdl_nlen);
NSString *name = [NSString stringWithUTF8String:nameBuf];
currentSnapshots[name] = @{
@"inBytes": @(if2m->ifm_data.ifi_ibytes),
@"outBytes": @(if2m->ifm_data.ifi_obytes),
@"inPackets": @(if2m->ifm_data.ifi_ipackets),
@"outPackets": @(if2m->ifm_data.ifi_opackets),
@"inErrors": @(if2m->ifm_data.ifi_ierrors),
@"outErrors": @(if2m->ifm_data.ifi_oerrors)
};
}
}
}
}
if (buf) free(buf);
}
// 2. Query IPv4 addresses via getifaddrs
NSMutableDictionary<NSString *, NSString *> *ipDict = [NSMutableDictionary dictionary];
struct ifaddrs *ifap = NULL;
if (getifaddrs(&ifap) == 0) {
for (struct ifaddrs *ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) {
char ipBuf[INET_ADDRSTRLEN] = {0};
struct sockaddr_in *sin = (struct sockaddr_in *)ifa->ifa_addr;
if (inet_ntop(AF_INET, &sin->sin_addr, ipBuf, sizeof(ipBuf))) {
NSString *name = [NSString stringWithUTF8String:ifa->ifa_name];
ipDict[name] = [NSString stringWithUTF8String:ipBuf];
}
}
}
freeifaddrs(ifap);
}
os_unfair_lock_lock(&_lock);
NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *prev = _previousSnapshots;
uint64_t prevTime = _previousTimestamp;
_previousSnapshots = currentSnapshots;
_previousTimestamp = now;
os_unfair_lock_unlock(&_lock);
NSTimeInterval timeDelta = 1.0;
if (prevTime > 0) {
uint64_t elapsed = now - prevTime;
timeDelta = (double)elapsed * _timebase.numer / _timebase.denom / 1e9;
}
return [MMNetworkBandwidthProvider calculateBandwidthMetricsWithCurrentSnapshots:currentSnapshots
previousSnapshots:prev
timeDelta:timeDelta
ipAddresses:ipDict];
}
@end
@@ -0,0 +1,27 @@
#ifndef MMNetworkSocketsProvider_h
#define MMNetworkSocketsProvider_h
#import <Foundation/Foundation.h>
#import "MMTelemetryProvider.h"
NS_ASSUME_NONNULL_BEGIN
/**
* MMNetworkSocketsProvider
* Inspects system-wide open TCP and UDP sockets, local/remote endpoints, connection states,
* and owning processes.
*/
@interface MMNetworkSocketsProvider : NSObject <MMTelemetryProvider>
- (instancetype)init;
/**
* Pure calculator / summarizer method for deterministic unit testing.
*/
+ (NSDictionary<NSString *, id> *)calculateSocketSummaryWithSocketList:(NSArray<NSDictionary<NSString *, id> *> *)sockets;
@end
NS_ASSUME_NONNULL_END
#endif /* MMNetworkSocketsProvider_h */
@@ -0,0 +1,152 @@
#import "MMNetworkSocketsProvider.h"
#import <libproc.h>
#import <sys/proc_info.h>
#import <arpa/inet.h>
@implementation MMNetworkSocketsProvider
- (instancetype)init {
self = [super init];
return self;
}
- (MMTelemetryDomain)domain {
return MMTelemetryDomainNetwork;
}
- (NSString *)providerIdentifier {
return @"com.i3omb.macmonitor.telemetry.network.sockets";
}
- (BOOL)isAvailable {
return YES;
}
static NSString *tcpStateString(int state) {
switch (state) {
case 0: return @"CLOSED";
case 1: return @"LISTEN";
case 2: return @"SYN_SENT";
case 3: return @"SYN_RCVD";
case 4: return @"ESTABLISHED";
case 5: return @"CLOSE_WAIT";
case 6: return @"FIN_WAIT_1";
case 7: return @"CLOSING";
case 8: return @"LAST_ACK";
case 9: return @"FIN_WAIT_2";
case 10: return @"TIME_WAIT";
default: return @"UNKNOWN";
}
}
+ (NSDictionary<NSString *, id> *)calculateSocketSummaryWithSocketList:(NSArray<NSDictionary<NSString *, id> *> *)sockets {
NSUInteger tcpCount = 0;
NSUInteger udpCount = 0;
NSUInteger listenCount = 0;
NSUInteger establishedCount = 0;
for (NSDictionary<NSString *, id> *sock in sockets) {
NSString *proto = sock[@"protocol"];
NSString *state = sock[@"state"];
if ([proto isEqualToString:@"TCP"]) {
tcpCount++;
if ([state isEqualToString:@"LISTEN"]) {
listenCount++;
} else if ([state isEqualToString:@"ESTABLISHED"]) {
establishedCount++;
}
} else if ([proto isEqualToString:@"UDP"]) {
udpCount++;
}
}
return @{
@"socketCount": @(sockets.count),
@"tcpCount": @(tcpCount),
@"udpCount": @(udpCount),
@"listenCount": @(listenCount),
@"establishedCount": @(establishedCount),
@"sockets": sockets
};
}
- (nullable NSDictionary<NSString *, id> *)sampleTelemetryWithError:(NSError **)error {
int pids[2048];
int bytes = proc_listpids(PROC_ALL_PIDS, 0, pids, sizeof(pids));
int pidCount = bytes / sizeof(int);
NSMutableArray<NSDictionary<NSString *, id> *> *sockets = [NSMutableArray array];
for (int i = 0; i < pidCount; i++) {
pid_t pid = pids[i];
if (pid <= 0) continue;
int sz = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
if (sz <= 0) continue;
struct proc_fdinfo *fds = malloc(sz);
if (!fds) continue;
int actual = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fds, sz);
int fdCount = actual / sizeof(struct proc_fdinfo);
char procNameBuf[256] = {0};
BOOL procNameFetched = NO;
for (int j = 0; j < fdCount; j++) {
if (fds[j].proc_fdtype == PROX_FDTYPE_SOCKET) {
struct socket_fdinfo si;
if (proc_pidfdinfo(pid, fds[j].proc_fd, PROC_PIDFDSOCKETINFO, &si, sizeof(si)) == sizeof(si)) {
int family = si.psi.soi_family;
if (family == AF_INET || family == AF_INET6) {
if (!procNameFetched) {
proc_name(pid, procNameBuf, sizeof(procNameBuf));
procNameFetched = YES;
}
char localIP[INET6_ADDRSTRLEN] = {0};
char remoteIP[INET6_ADDRSTRLEN] = {0};
int lport = 0, rport = 0;
NSString *familyStr = (family == AF_INET) ? @"IPv4" : @"IPv6";
NSString *proto = (si.psi.soi_type == SOCK_STREAM) ? @"TCP" : @"UDP";
NSString *state = @"NONE";
if (family == AF_INET) {
inet_ntop(AF_INET, &si.psi.soi_proto.pri_in.insi_laddr.ina_46.i46a_addr4, localIP, sizeof(localIP));
inet_ntop(AF_INET, &si.psi.soi_proto.pri_in.insi_faddr.ina_46.i46a_addr4, remoteIP, sizeof(remoteIP));
lport = ntohs(si.psi.soi_proto.pri_in.insi_lport);
rport = ntohs(si.psi.soi_proto.pri_in.insi_fport);
} else {
inet_ntop(AF_INET6, &si.psi.soi_proto.pri_in.insi_laddr.ina_6, localIP, sizeof(localIP));
inet_ntop(AF_INET6, &si.psi.soi_proto.pri_in.insi_faddr.ina_6, remoteIP, sizeof(remoteIP));
lport = ntohs(si.psi.soi_proto.pri_in.insi_lport);
rport = ntohs(si.psi.soi_proto.pri_in.insi_fport);
}
if (si.psi.soi_type == SOCK_STREAM) {
state = tcpStateString(si.psi.soi_proto.pri_tcp.tcpsi_state);
}
[sockets addObject:@{
@"pid": @(pid),
@"processName": [NSString stringWithUTF8String:procNameBuf],
@"protocol": proto,
@"family": familyStr,
@"localAddress": [NSString stringWithUTF8String:localIP],
@"localPort": @(lport),
@"remoteAddress": [NSString stringWithUTF8String:remoteIP],
@"remotePort": @(rport),
@"state": state
}];
}
}
}
}
free(fds);
}
return [MMNetworkSocketsProvider calculateSocketSummaryWithSocketList:sockets];
}
@end
@@ -0,0 +1,32 @@
#ifndef MMProcessDetailInspector_h
#define MMProcessDetailInspector_h
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* MMProcessDetailInspector
* Provides deep per-process inspection: open file descriptors, vnode file paths,
* active network sockets, and thread states.
*/
@interface MMProcessDetailInspector : NSObject
/**
* Inspects a running process by PID.
*/
+ (nullable NSDictionary<NSString *, id> *)inspectProcessWithPID:(pid_t)pid;
/**
* Pure summarizer method for deterministic unit testing.
*/
+ (NSDictionary<NSString *, id> *)summarizeInspectionResultsWithPID:(pid_t)pid
threads:(NSArray<NSDictionary<NSString *, id> *> *)threads
fds:(NSArray<NSDictionary<NSString *, id> *> *)fds
sockets:(NSArray<NSDictionary<NSString *, id> *> *)sockets;
@end
NS_ASSUME_NONNULL_END
#endif /* MMProcessDetailInspector_h */
@@ -0,0 +1,176 @@
#import "MMProcessDetailInspector.h"
#import <libproc.h>
#import <sys/proc_info.h>
#import <arpa/inet.h>
@implementation MMProcessDetailInspector
+ (NSDictionary<NSString *, id> *)summarizeInspectionResultsWithPID:(pid_t)pid
threads:(NSArray<NSDictionary<NSString *, id> *> *)threads
fds:(NSArray<NSDictionary<NSString *, id> *> *)fds
sockets:(NSArray<NSDictionary<NSString *, id> *> *)sockets {
return @{
@"pid": @(pid),
@"threadCount": @(threads.count),
@"openFDCount": @(fds.count),
@"socketCount": @(sockets.count),
@"threads": threads,
@"fileDescriptors": fds,
@"sockets": sockets
};
}
static NSString *runStateString(int state) {
switch (state) {
case 1: return @"Running";
case 2: return @"Stopped";
case 3: return @"Waiting";
case 4: return @"Uninterruptible";
case 5: return @"Halted";
default: return @"Unknown";
}
}
static NSString *tcpStateString(int state) {
switch (state) {
case 0: return @"CLOSED";
case 1: return @"LISTEN";
case 2: return @"SYN_SENT";
case 3: return @"SYN_RCVD";
case 4: return @"ESTABLISHED";
case 5: return @"CLOSE_WAIT";
case 6: return @"FIN_WAIT_1";
case 7: return @"CLOSING";
case 8: return @"LAST_ACK";
case 9: return @"FIN_WAIT_2";
case 10: return @"TIME_WAIT";
default: return @"UNKNOWN";
}
}
+ (nullable NSDictionary<NSString *, id> *)inspectProcessWithPID:(pid_t)pid {
if (pid <= 0) return nil;
// 1. Enumerate threads
uint64_t threadIds[512];
int threadBytes = proc_pidinfo(pid, PROC_PIDLISTTHREADS, 0, threadIds, sizeof(threadIds));
int threadCount = threadBytes / sizeof(uint64_t);
NSMutableArray<NSDictionary<NSString *, id> *> *threads = [NSMutableArray arrayWithCapacity:threadCount];
for (int t = 0; t < threadCount; t++) {
uint64_t tid = threadIds[t];
struct proc_threadinfo thi;
if (proc_pidinfo(pid, PROC_PIDTHREADINFO, tid, &thi, sizeof(thi)) == sizeof(thi)) {
[threads addObject:@{
@"threadId": @(tid),
@"userTimeNs": @(thi.pth_user_time),
@"systemTimeNs": @(thi.pth_system_time),
@"cpuPercent": @(thi.pth_cpu_usage),
@"state": runStateString(thi.pth_run_state),
@"priority": @(thi.pth_priority),
@"currentPriority": @(thi.pth_curpri)
}];
}
}
// 2. Enumerate File Descriptors & Sockets
NSMutableArray<NSDictionary<NSString *, id> *> *fdsList = [NSMutableArray array];
NSMutableArray<NSDictionary<NSString *, id> *> *socketsList = [NSMutableArray array];
int sz = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
if (sz > 0) {
struct proc_fdinfo *fds = malloc(sz);
if (fds) {
int actual = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fds, sz);
int fdCount = actual / sizeof(struct proc_fdinfo);
for (int j = 0; j < fdCount; j++) {
int fd = fds[j].proc_fd;
uint32_t fdType = fds[j].proc_fdtype;
if (fdType == PROX_FDTYPE_VNODE) {
struct vnode_fdinfowithpath vi;
if (proc_pidfdinfo(pid, fd, PROC_PIDFDVNODEPATHINFO, &vi, sizeof(vi)) == sizeof(vi)) {
NSString *path = [NSString stringWithUTF8String:vi.pvip.vip_path];
[fdsList addObject:@{
@"fd": @(fd),
@"type": @"File",
@"path": path ?: @"(unknown)"
}];
}
} else if (fdType == PROX_FDTYPE_SOCKET) {
struct socket_fdinfo si;
if (proc_pidfdinfo(pid, fd, PROC_PIDFDSOCKETINFO, &si, sizeof(si)) == sizeof(si)) {
int family = si.psi.soi_family;
if (family == AF_INET || family == AF_INET6) {
char localIP[INET6_ADDRSTRLEN] = {0};
char remoteIP[INET6_ADDRSTRLEN] = {0};
int lport = 0, rport = 0;
NSString *proto = (si.psi.soi_type == SOCK_STREAM) ? @"TCP" : @"UDP";
NSString *state = @"NONE";
if (family == AF_INET) {
inet_ntop(AF_INET, &si.psi.soi_proto.pri_in.insi_laddr.ina_46.i46a_addr4, localIP, sizeof(localIP));
inet_ntop(AF_INET, &si.psi.soi_proto.pri_in.insi_faddr.ina_46.i46a_addr4, remoteIP, sizeof(remoteIP));
lport = ntohs(si.psi.soi_proto.pri_in.insi_lport);
rport = ntohs(si.psi.soi_proto.pri_in.insi_fport);
} else {
inet_ntop(AF_INET6, &si.psi.soi_proto.pri_in.insi_laddr.ina_6, localIP, sizeof(localIP));
inet_ntop(AF_INET6, &si.psi.soi_proto.pri_in.insi_faddr.ina_6, remoteIP, sizeof(remoteIP));
lport = ntohs(si.psi.soi_proto.pri_in.insi_lport);
rport = ntohs(si.psi.soi_proto.pri_in.insi_fport);
}
if (si.psi.soi_type == SOCK_STREAM) {
state = tcpStateString(si.psi.soi_proto.pri_tcp.tcpsi_state);
}
NSDictionary<NSString *, id> *sockDict = @{
@"fd": @(fd),
@"protocol": proto,
@"localAddress": [NSString stringWithUTF8String:localIP],
@"localPort": @(lport),
@"remoteAddress": [NSString stringWithUTF8String:remoteIP],
@"remotePort": @(rport),
@"state": state
};
[socketsList addObject:sockDict];
[fdsList addObject:@{
@"fd": @(fd),
@"type": @"Socket",
@"path": [NSString stringWithFormat:@"%@ %@:%d -> %@:%d", proto, [NSString stringWithUTF8String:localIP], lport, [NSString stringWithUTF8String:remoteIP], rport]
}];
} else {
[fdsList addObject:@{
@"fd": @(fd),
@"type": @"Socket (Unix/Other)",
@"path": @"Unix Domain Socket"
}];
}
}
} else if (fdType == PROX_FDTYPE_PIPE) {
[fdsList addObject:@{
@"fd": @(fd),
@"type": @"Pipe",
@"path": @"FIFO/Pipe"
}];
} else {
[fdsList addObject:@{
@"fd": @(fd),
@"type": @"Other",
@"path": @""
}];
}
}
free(fds);
}
}
return [MMProcessDetailInspector summarizeInspectionResultsWithPID:pid
threads:threads
fds:fdsList
sockets:socketsList];
}
@end
@@ -0,0 +1,34 @@
#ifndef MMProcessTelemetryProvider_h
#define MMProcessTelemetryProvider_h
#import <Foundation/Foundation.h>
#import "MMTelemetryProvider.h"
NS_ASSUME_NONNULL_BEGIN
/**
* MMProcessTelemetryProvider
* Live process explorer sampling CPU utilization, resident memory (RSS),
* virtual memory, thread counts, and process hierarchy.
*/
@interface MMProcessTelemetryProvider : NSObject <MMTelemetryProvider>
- (instancetype)init;
/**
* Safely terminates a process via SIGTERM or SIGKILL.
*/
+ (BOOL)terminateProcessWithPID:(pid_t)pid force:(BOOL)force;
/**
* Pure calculator method for deterministic unit testing.
*/
+ (NSArray<NSDictionary<NSString *, id> *> *)calculateProcessListWithRawProcesses:(NSArray<NSDictionary<NSString *, id> *> *)rawProcesses
previousCPUTimes:(nullable NSDictionary<NSNumber *, NSNumber *> *)previousCPUTimes
timeDelta:(NSTimeInterval)timeDelta;
@end
NS_ASSUME_NONNULL_END
#endif /* MMProcessTelemetryProvider_h */
@@ -0,0 +1,160 @@
#import "MMProcessTelemetryProvider.h"
#import <libproc.h>
#import <sys/proc_info.h>
#import <pwd.h>
#import <signal.h>
#import <mach/mach_time.h>
#import <os/lock.h>
@interface MMProcessTelemetryProvider () {
os_unfair_lock _lock;
NSMutableDictionary<NSNumber *, NSNumber *> *_previousCPUTimes;
uint64_t _previousTimestamp;
mach_timebase_info_data_t _timebase;
NSMutableDictionary<NSNumber *, NSString *> *_usernameCache;
}
@end
@implementation MMProcessTelemetryProvider
- (instancetype)init {
self = [super init];
if (self) {
_lock = OS_UNFAIR_LOCK_INIT;
_previousCPUTimes = [NSMutableDictionary dictionary];
_previousTimestamp = 0;
_usernameCache = [NSMutableDictionary dictionary];
mach_timebase_info(&_timebase);
}
return self;
}
- (MMTelemetryDomain)domain {
return MMTelemetryDomainProcess;
}
- (NSString *)providerIdentifier {
return @"com.i3omb.macmonitor.telemetry.process";
}
- (BOOL)isAvailable {
return YES;
}
+ (BOOL)terminateProcessWithPID:(pid_t)pid force:(BOOL)force {
int sig = force ? SIGKILL : SIGTERM;
return kill(pid, sig) == 0;
}
+ (NSArray<NSDictionary<NSString *, id> *> *)calculateProcessListWithRawProcesses:(NSArray<NSDictionary<NSString *, id> *> *)rawProcesses
previousCPUTimes:(nullable NSDictionary<NSNumber *, NSNumber *> *)previousCPUTimes
timeDelta:(NSTimeInterval)timeDelta {
NSMutableArray<NSDictionary<NSString *, id> *> *processed = [NSMutableArray arrayWithCapacity:rawProcesses.count];
for (NSDictionary<NSString *, id> *raw in rawProcesses) {
NSNumber *pidNum = raw[@"pid"];
uint64_t currCPUTime = [raw[@"cpuTimeNs"] unsignedLongLongValue];
double cpuPercent = 0.0;
if (previousCPUTimes && previousCPUTimes[pidNum]) {
uint64_t prevCPUTime = [previousCPUTimes[pidNum] unsignedLongLongValue];
if (currCPUTime >= prevCPUTime && timeDelta > 0.001) {
uint64_t deltaNs = currCPUTime - prevCPUTime;
double deltaSec = (double)deltaNs / 1e9;
cpuPercent = (deltaSec / timeDelta) * 100.0;
}
}
NSMutableDictionary<NSString *, id> *entry = [raw mutableCopy];
entry[@"cpuPercent"] = @(cpuPercent);
[processed addObject:entry];
}
// Sort descending by cpuPercent
[processed sortUsingComparator:^NSComparisonResult(NSDictionary<NSString *, id> *obj1, NSDictionary<NSString *, id> *obj2) {
NSNumber *c1 = obj1[@"cpuPercent"];
NSNumber *c2 = obj2[@"cpuPercent"];
return [c2 compare:c1];
}];
return processed;
}
- (nullable NSDictionary<NSString *, id> *)sampleTelemetryWithError:(NSError **)error {
uint64_t now = mach_absolute_time();
int pids[4096];
int bytes = proc_listpids(PROC_ALL_PIDS, 0, pids, sizeof(pids));
int pidCount = bytes / sizeof(int);
NSMutableArray<NSDictionary<NSString *, id> *> *rawList = [NSMutableArray arrayWithCapacity:pidCount];
NSMutableDictionary<NSNumber *, NSNumber *> *currentCPUTimes = [NSMutableDictionary dictionaryWithCapacity:pidCount];
NSUInteger totalThreads = 0;
for (int i = 0; i < pidCount; i++) {
pid_t pid = pids[i];
if (pid <= 0) continue;
struct proc_taskallinfo tai;
if (proc_pidinfo(pid, PROC_PIDTASKALLINFO, 0, &tai, sizeof(tai)) != sizeof(tai)) {
continue;
}
uint64_t cpuTimeNs = tai.ptinfo.pti_total_user + tai.ptinfo.pti_total_system;
currentCPUTimes[@(pid)] = @(cpuTimeNs);
totalThreads += tai.ptinfo.pti_threadnum;
// Resolve username
NSNumber *uidNum = @(tai.pbsd.pbi_uid);
NSString *username = _usernameCache[uidNum];
if (!username) {
struct passwd *pw = getpwuid(tai.pbsd.pbi_uid);
username = pw ? [NSString stringWithUTF8String:pw->pw_name] : [uidNum stringValue];
_usernameCache[uidNum] = username;
}
NSString *pname = [NSString stringWithUTF8String:tai.pbsd.pbi_name];
[rawList addObject:@{
@"pid": @(pid),
@"ppid": @(tai.pbsd.pbi_ppid),
@"uid": uidNum,
@"username": username,
@"name": pname,
@"cpuTimeNs": @(cpuTimeNs),
@"residentBytes": @(tai.ptinfo.pti_resident_size),
@"virtualBytes": @(tai.ptinfo.pti_virtual_size),
@"threadCount": @(tai.ptinfo.pti_threadnum),
@"runningThreads": @(tai.ptinfo.pti_numrunning)
}];
}
os_unfair_lock_lock(&_lock);
NSDictionary<NSNumber *, NSNumber *> *prev = [_previousCPUTimes copy];
uint64_t prevTime = _previousTimestamp;
_previousCPUTimes = currentCPUTimes;
_previousTimestamp = now;
os_unfair_lock_unlock(&_lock);
NSTimeInterval timeDelta = 1.0;
if (prevTime > 0) {
uint64_t elapsed = now - prevTime;
timeDelta = (double)elapsed * _timebase.numer / _timebase.denom / 1e9;
}
NSArray<NSDictionary<NSString *, id> *> *processed = [MMProcessTelemetryProvider calculateProcessListWithRawProcesses:rawList
previousCPUTimes:prev
timeDelta:timeDelta];
return @{
@"processCount": @(processed.count),
@"totalThreads": @(totalThreads),
@"processes": processed,
@"timeDelta": @(timeDelta)
};
}
@end
+54
View File
@@ -0,0 +1,54 @@
import XCTest
@testable import MacMonitor
final class MMGPUTests: XCTestCase {
func testGPUMetricsCalculation() {
let mockGPUs: [[String: Any]] = [
[
"name": "Intel Iris Plus Graphics 655",
"type": "Integrated",
"utilization": 15.0,
"vramUsedBytes": 500_000_000,
"vramTotalBytes": 1_500_000_000,
"temperature": 45.0,
"isLowPower": true,
"isRemovable": false
],
[
"name": "AMD Radeon Pro 560X",
"type": "Discrete",
"utilization": 75.0,
"vramUsedBytes": 3_000_000_000,
"vramTotalBytes": 4_000_000_000,
"temperature": 68.0,
"isLowPower": false,
"isRemovable": false
]
]
let metrics = MMGPUTelemetryProvider.calculateGPUMetrics(withDevices: mockGPUs)
let count = metrics["gpuCount"] as? Int ?? 0
let avg = metrics["averageUtilization"] as? Double ?? 0
let peak = metrics["peakUtilization"] as? Double ?? 0
let active = metrics["activeGPUName"] as? String ?? ""
XCTAssertEqual(count, 2)
XCTAssertEqual(avg, 45.0, accuracy: 0.1)
XCTAssertEqual(peak, 75.0, accuracy: 0.1)
XCTAssertEqual(active, "AMD Radeon Pro 560X")
}
func testLiveGPUProvider() throws {
let provider = MMGPUTelemetryProvider()
XCTAssertEqual(provider.domain, .gpu)
XCTAssertEqual(provider.providerIdentifier, "com.i3omb.macmonitor.telemetry.gpu")
let sample = try provider.sampleTelemetry()
XCTAssertNotNil(sample)
XCTAssertNotNil(sample["gpuCount"])
XCTAssertNotNil(sample["devices"])
XCTAssertNotNil(sample["activeGPUName"])
}
}
+85
View File
@@ -0,0 +1,85 @@
import XCTest
@testable import MacMonitor
final class MMNetworkBandwidthTests: XCTestCase {
func testNetworkBandwidthCalculation() {
let prev: [String: [String: NSNumber]] = [
"en0": [
"inBytes": NSNumber(value: 50_000_000),
"outBytes": NSNumber(value: 10_000_000),
"inPackets": NSNumber(value: 40_000),
"outPackets": NSNumber(value: 20_000),
"inErrors": NSNumber(value: 0),
"outErrors": NSNumber(value: 0)
],
"lo0": [
"inBytes": NSNumber(value: 5_000_000),
"outBytes": NSNumber(value: 5_000_000),
"inPackets": NSNumber(value: 5_000),
"outPackets": NSNumber(value: 5_000),
"inErrors": NSNumber(value: 0),
"outErrors": NSNumber(value: 0)
]
]
let curr: [String: [String: NSNumber]] = [
"en0": [
"inBytes": NSNumber(value: 60_000_000), // delta in = 10,000,000 bytes
"outBytes": NSNumber(value: 12_000_000), // delta out = 2,000,000 bytes
"inPackets": NSNumber(value: 48_000), // delta in = 8,000 pkts
"outPackets": NSNumber(value: 24_000), // delta out = 4,000 pkts
"inErrors": NSNumber(value: 0),
"outErrors": NSNumber(value: 0)
],
"lo0": [
"inBytes": NSNumber(value: 7_000_000),
"outBytes": NSNumber(value: 7_000_000),
"inPackets": NSNumber(value: 7_000),
"outPackets": NSNumber(value: 7_000),
"inErrors": NSNumber(value: 0),
"outErrors": NSNumber(value: 0)
]
]
let timeDelta: TimeInterval = 2.0 // 2 seconds
let ipDict: [String: String] = ["en0": "192.168.1.100", "lo0": "127.0.0.1"]
let metrics = MMNetworkBandwidthProvider.calculateBandwidthMetrics(
withCurrentSnapshots: curr,
previousSnapshots: prev,
timeDelta: timeDelta,
ipAddresses: ipDict
)
let totalDownBps = metrics["totalDownloadBytesPerSec"] as? Double ?? 0
let totalUpBps = metrics["totalUploadBytesPerSec"] as? Double ?? 0
let totalDownPps = metrics["totalDownloadPacketsPerSec"] as? Double ?? 0
let totalUpPps = metrics["totalUploadPacketsPerSec"] as? Double ?? 0
let primary = metrics["primaryInterface"] as? String ?? ""
let interfaces = metrics["interfaces"] as? [[String: Any]] ?? []
// en0 delta in = 10MB / 2s = 5,000,000 B/s (lo0 is excluded from total)
XCTAssertEqual(totalDownBps, 5_000_000.0, accuracy: 1.0)
// en0 delta out = 2MB / 2s = 1,000,000 B/s
XCTAssertEqual(totalUpBps, 1_000_000.0, accuracy: 1.0)
// en0 delta in pkts = 8,000 / 2s = 4,000 pps
XCTAssertEqual(totalDownPps, 4000.0, accuracy: 0.1)
// en0 delta out pkts = 4,000 / 2s = 2,000 pps
XCTAssertEqual(totalUpPps, 2000.0, accuracy: 0.1)
XCTAssertEqual(primary, "en0")
XCTAssertEqual(interfaces.count, 2)
}
func testLiveNetworkBandwidthProvider() throws {
let provider = MMNetworkBandwidthProvider()
XCTAssertEqual(provider.domain, .network)
XCTAssertEqual(provider.providerIdentifier, "com.i3omb.macmonitor.telemetry.network.bandwidth")
let sample = try provider.sampleTelemetry()
XCTAssertNotNil(sample)
XCTAssertNotNil(sample["totalDownloadBytesPerSec"])
XCTAssertNotNil(sample["totalUploadBytesPerSec"])
XCTAssertNotNil(sample["interfaces"])
}
}
+68
View File
@@ -0,0 +1,68 @@
import XCTest
@testable import MacMonitor
final class MMNetworkSocketsTests: XCTestCase {
func testSocketSummaryCalculation() {
let testSockets: [[String: Any]] = [
[
"pid": 100,
"processName": "web_server",
"protocol": "TCP",
"family": "IPv4",
"localAddress": "0.0.0.0",
"localPort": 8080,
"remoteAddress": "0.0.0.0",
"remotePort": 0,
"state": "LISTEN"
],
[
"pid": 200,
"processName": "browser",
"protocol": "TCP",
"family": "IPv4",
"localAddress": "192.168.1.50",
"localPort": 54321,
"remoteAddress": "142.250.190.46",
"remotePort": 443,
"state": "ESTABLISHED"
],
[
"pid": 300,
"processName": "dns_daemon",
"protocol": "UDP",
"family": "IPv4",
"localAddress": "0.0.0.0",
"localPort": 53,
"remoteAddress": "0.0.0.0",
"remotePort": 0,
"state": "NONE"
]
]
let summary = MMNetworkSocketsProvider.calculateSocketSummary(withSocketList: testSockets)
let total = summary["socketCount"] as? Int ?? 0
let tcp = summary["tcpCount"] as? Int ?? 0
let udp = summary["udpCount"] as? Int ?? 0
let listen = summary["listenCount"] as? Int ?? 0
let established = summary["establishedCount"] as? Int ?? 0
XCTAssertEqual(total, 3)
XCTAssertEqual(tcp, 2)
XCTAssertEqual(udp, 1)
XCTAssertEqual(listen, 1)
XCTAssertEqual(established, 1)
}
func testLiveNetworkSocketsProvider() throws {
let provider = MMNetworkSocketsProvider()
XCTAssertEqual(provider.domain, .network)
XCTAssertEqual(provider.providerIdentifier, "com.i3omb.macmonitor.telemetry.network.sockets")
let sample = try provider.sampleTelemetry()
XCTAssertNotNil(sample)
XCTAssertNotNil(sample["socketCount"])
XCTAssertNotNil(sample["sockets"])
}
}
+50
View File
@@ -0,0 +1,50 @@
import XCTest
@testable import MacMonitor
final class MMProcessDetailsTests: XCTestCase {
func testInspectionSummaryCalculation() {
let mockThreads: [[String: Any]] = [
["threadId": 1, "state": "Running"],
["threadId": 2, "state": "Waiting"]
]
let mockFDs: [[String: Any]] = [
["fd": 0, "type": "File", "path": "/dev/null"],
["fd": 1, "type": "File", "path": "/tmp/test.log"],
["fd": 3, "type": "Socket", "path": "TCP 127.0.0.1:80 -> 127.0.0.1:50000"]
]
let mockSockets: [[String: Any]] = [
["fd": 3, "protocol": "TCP", "localAddress": "127.0.0.1", "localPort": 80, "state": "LISTEN"]
]
let summary = MMProcessDetailInspector.summarizeInspectionResults(
withPID: 1234,
threads: mockThreads,
fds: mockFDs,
sockets: mockSockets
)
let pid = summary["pid"] as? Int ?? 0
let threadCount = summary["threadCount"] as? Int ?? 0
let openFDCount = summary["openFDCount"] as? Int ?? 0
let socketCount = summary["socketCount"] as? Int ?? 0
XCTAssertEqual(pid, 1234)
XCTAssertEqual(threadCount, 2)
XCTAssertEqual(openFDCount, 3)
XCTAssertEqual(socketCount, 1)
}
func testLiveProcessInspection() {
let currentPid = getpid()
let result = MMProcessDetailInspector.inspectProcess(withPID: currentPid)
XCTAssertNotNil(result)
let threadCount = result?["threadCount"] as? Int ?? 0
XCTAssertGreaterThan(threadCount, 0)
let fds = result?["fileDescriptors"] as? [[String: Any]]
XCTAssertNotNil(fds)
}
}
+69
View File
@@ -0,0 +1,69 @@
import XCTest
@testable import MacMonitor
final class MMProcessTests: XCTestCase {
func testProcessCPUPercentCalculation() {
let prevCPUTimes: [NSNumber: NSNumber] = [
100: NSNumber(value: 1_000_000_000), // 1.0s
200: NSNumber(value: 500_000_000) // 0.5s
]
let rawProcesses: [[String: Any]] = [
[
"pid": 100,
"ppid": 1,
"uid": 501,
"username": "tester",
"name": "cpu_hog",
"cpuTimeNs": NSNumber(value: 2_000_000_000), // delta = 1.0s over 2.0s = 50% CPU
"residentBytes": NSNumber(value: 50_000_000),
"virtualBytes": NSNumber(value: 100_000_000),
"threadCount": 4,
"runningThreads": 1
],
[
"pid": 200,
"ppid": 1,
"uid": 501,
"username": "tester",
"name": "idle_app",
"cpuTimeNs": NSNumber(value: 520_000_000), // delta = 0.02s over 2.0s = 1% CPU
"residentBytes": NSNumber(value: 20_000_000),
"virtualBytes": NSNumber(value: 50_000_000),
"threadCount": 2,
"runningThreads": 0
]
]
let timeDelta: TimeInterval = 2.0
let results = MMProcessTelemetryProvider.calculateProcessList(
withRawProcesses: rawProcesses,
previousCPUTimes: prevCPUTimes,
timeDelta: timeDelta
)
XCTAssertEqual(results.count, 2)
// First entry should be highest CPU
XCTAssertEqual(results[0]["name"] as? String, "cpu_hog")
let hogCPU = results[0]["cpuPercent"] as? Double ?? 0
XCTAssertEqual(hogCPU, 50.0, accuracy: 0.1)
let idleCPU = results[1]["cpuPercent"] as? Double ?? 0
XCTAssertEqual(idleCPU, 1.0, accuracy: 0.1)
}
func testLiveProcessProvider() throws {
let provider = MMProcessTelemetryProvider()
XCTAssertEqual(provider.domain, .process)
XCTAssertEqual(provider.providerIdentifier, "com.i3omb.macmonitor.telemetry.process")
let sample = try provider.sampleTelemetry()
XCTAssertNotNil(sample)
let processCount = sample["processCount"] as? Int ?? 0
XCTAssertGreaterThan(processCount, 0)
XCTAssertNotNil(sample["processes"])
XCTAssertNotNil(sample["totalThreads"])
}
}