34 lines
1.1 KiB
Objective-C
34 lines
1.1 KiB
Objective-C
#ifndef MMLoadAverageProvider_h
|
|
#define MMLoadAverageProvider_h
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "MMTelemetryProvider.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/**
|
|
* MMLoadAverageProvider
|
|
* Samples 1m, 5m, and 15m system load averages, Mach concurrency factors,
|
|
* and system-wide task and thread counts.
|
|
*/
|
|
@interface MMLoadAverageProvider : NSObject <MMTelemetryProvider>
|
|
|
|
- (instancetype)init;
|
|
|
|
/**
|
|
* Pure calculator method for deterministic unit testing.
|
|
*/
|
|
+ (NSDictionary<NSString *, id> *)calculateLoadMetricsWithLoad1:(double)load1
|
|
load5:(double)load5
|
|
load15:(double)load15
|
|
taskCount:(int)taskCount
|
|
threadCount:(int)threadCount
|
|
cpuCount:(int)cpuCount
|
|
machFactor:(double)machFactor;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
#endif /* MMLoadAverageProvider_h */
|