Files
gronodandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> 4a8fd0e5ef fix(telemetry): realign snapshot contract — provider IDs and dictionary field keys (fixes #30, fixes #31)
Providers emitted identifiers and field keys that decodeSnapshot never
looked up, leaving CPU/kernel/load/disk sections zeroed and memory%,
storage%, network, process RSS, and fan fields decoded as zero.

Store-side decode now reads the emitted schema; providers gain the
previously-missing fields: network isUp (IFF_UP via getifaddrs), process
isStopped/isZombie (pbi_status), fan name (F{i}ID). Memory utilization is
computed as used/total in the decoder. decodeSnapshot is internal for
@testable access; new MMSnapshotContractTests cover the emitted-key
contract with synthetic dictionaries (93 tests total, 0 failures).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-08 15:09:19 +01:00

32 lines
853 B
Objective-C

#ifndef MMFanTelemetryProvider_h
#define MMFanTelemetryProvider_h
#import <Foundation/Foundation.h>
#import "MMTelemetryProvider.h"
#import "MMAppleSMCClient.h"
NS_ASSUME_NONNULL_BEGIN
/**
* MMFanTelemetryProvider
* Samples multi-fan telemetry from AppleSMC: current RPM, min RPM, max RPM, target RPM,
* and fan utilization percentages.
*/
@interface MMFanTelemetryProvider : NSObject <MMTelemetryProvider>
@property (nonatomic, strong, readonly) MMAppleSMCClient *smcClient;
@property (nonatomic, readonly) NSInteger fanCount;
- (instancetype)initWithSMCClient:(MMAppleSMCClient *)client;
/**
* Static calculator method for deterministic unit testing.
*/
+ (NSDictionary<NSString *, id> *)calculateFanMetricsFromFanList:(NSArray<NSDictionary<NSString *, id> *> *)fanList;
@end
NS_ASSUME_NONNULL_END
#endif /* MMFanTelemetryProvider_h */