diff options
Diffstat (limited to 'platform/darwin/src/MGLMetricsManager.h')
-rw-r--r-- | platform/darwin/src/MGLMetricsManager.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLMetricsManager.h b/platform/darwin/src/MGLMetricsManager.h new file mode 100644 index 0000000000..73756cebed --- /dev/null +++ b/platform/darwin/src/MGLMetricsManager.h @@ -0,0 +1,32 @@ +#import <Foundation/Foundation.h> +#import "MGLFoundation.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, MGLMetricType) { + MGLMetricTypePerformance = 0, +}; + +@protocol MGLMetricsDelegate <NSObject> + +- (BOOL)shouldHandleMetric:(MGLMetricType)metricType; +- (void)didCollectMetric:(MGLMetricType)metricType withAttributes:(NSDictionary *)attributes; + +@end + +typedef void (^MGLEventHandler)(NSString *eventName, NSDictionary *attributes); + +MGL_EXPORT +@interface MGLMetricsManager : NSObject + +@property (class, nonatomic, readonly) MGLMetricsManager *sharedManager; + +@property (nonatomic, weak) id<MGLMetricsDelegate> delegate; + +#if TARGET_OS_IOS +- (void)pushMetric:(MGLMetricType)metricType withAttributes:(NSDictionary *)attributes; +#endif + +@end + +NS_ASSUME_NONNULL_END |