Files
MacMonitor/Sources/Core/MMTelemetryProvider.h

35 lines
959 B
Objective-C

#ifndef MMTelemetryProvider_h
#define MMTelemetryProvider_h
#import <Foundation/Foundation.h>
#import "MMTelemetryDomain.h"
NS_ASSUME_NONNULL_BEGIN
/**
* MMTelemetryProvider
* Protocol defining the standard contract for all low-level telemetry sampling engines.
*/
@protocol MMTelemetryProvider <NSObject>
@property (nonatomic, readonly) MMTelemetryDomain domain;
@property (nonatomic, readonly, copy) NSString *providerIdentifier;
@property (nonatomic, readonly, getter=isAvailable) BOOL available;
/**
* Samples instantaneous or delta telemetry metrics.
* Called exclusively on the background utility telemetry queue: com.i3omb.macmonitor.telemetry.
* Returns an immutable dictionary containing scalar values, strings, or arrays.
*/
- (nullable NSDictionary<NSString *, id> *)sampleTelemetryWithError:(NSError **)error;
@optional
- (void)startMonitoring;
- (void)stopMonitoring;
@end
NS_ASSUME_NONNULL_END
#endif /* MMTelemetryProvider_h */