-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetricKit.framework.h
1246 lines (1049 loc) · 41.7 KB
/
MetricKit.framework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== MetricKit.framework/Headers/MXMetaData.h
//
// MXMetaData.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXMetaData
@abstract A class that contains miscellaneous metadata about an associated metric payload.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXMetaData : NSObject <NSSecureCoding>
/*!
@property regionFormat
@abstract An NSString designating the region format associated with the application.
*/
@property (readonly, strong, nonnull) NSString *regionFormat;
/*!
@property osVersion
@abstract An NSString designating the OS version associated with the device.
*/
@property (readonly, strong, nonnull) NSString *osVersion;
/*!
@property deviceType
@abstract An NSString designating the device type associated with this device.
*/
@property (readonly, strong, nonnull) NSString *deviceType;
/*!
@property applicationBuildVersion
@abstract An NSString designating the app build version.
*/
@property (readonly, strong, nonnull) NSString *applicationBuildVersion;
/*!
@method JSONRepresentation
@abstract Convenience method to return a JSON representation of this metadata.
@result An NSData object containing the JSON representation
*/
- (NSData *)JSONRepresentation;
/*!
@method DictionaryRepresentation
@abstract Convenience method to return a NSDictionary representation of this metadata.
@result An NSDictionary object containing the dictionary representation
*/
- (NSDictionary *)DictionaryRepresentation;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXAppResponsivenessMetric.h
//
// MXAppResponsivenessMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <os/availability.h>
#import <MetricKit/MXHistogram.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXAppResponsivenessMetric
@abstract An MXMetric subclass that encapsulates app responsiveness metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXAppResponsivenessMetric : MXMetric
/*!
@property histogrammedApplicationHangTime
@abstract Histogrammed app hang time data.
@discussion Applications are considered to be "hanging" when they are unable to handle user input responsively.
@discussion The durations for periods of hangs will be reported in the histogram returned here.
@discussion Application hang times that exceeds 9 seconds of wall clock time are reported in the final bucket of the histogram.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) MXHistogram<NSUnitDuration *> *histogrammedApplicationHangTime;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXUnit.h
//
// MXUnit.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXUnitSignalBars
@abstract An NSUnit subclass representing the number of signal bars for signal strength.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXUnitSignalBars : NSDimension
/*
Base unit - bars
*/
@property (class, readonly, copy) MXUnitSignalBars *bars;
@end
/*!
@class MXUnitAveragePixelLuminance
@abstract An NSUnit subclass representing the linear space Display APL.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXUnitAveragePixelLuminance : NSDimension
/*
Base unit - apl
*/
@property (class, readonly, copy) MXUnitAveragePixelLuminance *apl;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXDisplayMetric.h
//
// MXDisplayMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXUnit.h>
#import <os/availability.h>
#import <MetricKit/MXAverage.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXDisplayMetric
@abstract An MXMetric subclass that encapsulates display metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXDisplayMetric : MXMetric
/*!
@property averagePixelLuminance
@abstract Average Pixel Luminance for the application.
@discussion APL data ranges from 0-100, in increments of 1.
@discussion This value is null when the device does not support APL.
@discussion Dimensioned as MXUnitAveragePixelLuminance.
*/
@property (readonly, strong, nullable) MXAverage<MXUnitAveragePixelLuminance *> *averagePixelLuminance;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXLocationActivityMetric.h
//
// MXLocationActivityMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXLocationActivityMetric
@abstract An MXMetric subclass that encapsulates location metrics
@discussion The metrics contained in this class describe properties of location activity. See MXAppRunTimeMetric for time spent performing location activities.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXLocationActivityMetric : MXMetric
/*!
@property cumulativeBestAccuracyTime
@abstract Cumulative time spent acquiring location at kCLLocationAccuracyBest.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeBestAccuracyTime;
/*!
@property cumulativeBestAccuracyForNavigationTime
@abstract Cumulative time spent acquiring location at kCLLocationAccuracyBestForNavigation.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeBestAccuracyForNavigationTime;
/*!
@property cumulativeNearestTenMetersAccuracyTime
@abstract Cumulative time spent acquiring location at kCLLocationAccuracyNearestTenMeters.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeNearestTenMetersAccuracyTime;
/*!
@property cumulativeHundredMetersAccuracyTime
@abstract Cumulative time spent acquiring location at kCLLocationAccuracyHundredMeters.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeHundredMetersAccuracyTime;
/*!
@property cumulativeKilometerAccuracyTime
@abstract Cumulative time spent acquiring location at kCLLocationAccuracyKilometer.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeKilometerAccuracyTime;
/*!
@property cumulativeThreeKilometersAccuracyTime
@abstract Cumulative time spent acquiring location at kCLLocationAccuracyThreeKilometers.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeThreeKilometersAccuracyTime;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXGPUMetric.h
//
// MXGPUMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
#import <MetricKit/MXMetric.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXGPUMetric
@abstract An MXMetric subclass that encapsulates GPU metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXGPUMetric : MXMetric
/*!
@property cumulativeGPUTime
@abstract GPU time aggregated cumulatively.
@discussion The data here represents the total GPU time an application consumed over the date range of the containing payload.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeGPUTime;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXNetworkTransferMetric.h
//
// MXNetworkTransferMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXUnit.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXNetworkTransferMetric
@abstract An MXMetric subclass that encapsulates network transfer metrics
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXNetworkTransferMetric : MXMetric
/*!
@property cumulativeWifiUpload
@abstract Cumulative amount of data uploaded over WiFi.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitInformationStorage *> *cumulativeWifiUpload;
/*!
@property cumulativeWifiDownload
@abstract Cumulative amount of data downloaded over WiFi.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitInformationStorage *> *cumulativeWifiDownload;
/*!
@property cumulativeCellularUpload
@abstract Cumulative amount of data uploaded over cellular networks.
@discussion This data is radio access technology agnostic.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitInformationStorage *> *cumulativeCellularUpload;
/*!
@property cumulativeCellularDownload
@abstract Cumulative amount of data downloaded over cellular networks.
@discussion This data is radio access technology agnostic.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitInformationStorage *> *cumulativeCellularDownload;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXDiskIOMetric.h
//
// MXDiskIOMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXUnit.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXDiskIOMetric
@abstract An MXMetric subclass that encapsulates disk IO metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXDiskIOMetric : MXMetric
/*!
@property cumulativeLogicalWrites
@abstract Cumulative amount of logical writes.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitInformationStorage *> *cumulativeLogicalWrites;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXSignpostMetric.h
//
// MXSignpostMetric.h
// MetricKit
//
// Copyright (c) 2019 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXHistogram.h>
#import <MetricKit/MXCPUMetric.h>
#import <MetricKit/MXMemoryMetric.h>
#import <MetricKit/MXDiskIOMetric.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXSignpostIntervalData
@abstract A class that encapsulates metrics associated with app specific signpost intervals.
@discussion These metrics will be collected and aggregated if the associated signposts were emit using the appropriate API.
@discussion To limit on-device overhead, the system will automatically limit the number of signposts (emitted using the MetricKit log handle) processed.
@discussion Avoid losing telemetry by limiting usage of signposts (emitted using the MetricKit log handle) to critical sections of code.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXSignpostIntervalData : NSObject <NSSecureCoding>
/*!
@property histogrammedSignpostDuration
@abstract A histogram of signpost intervals durations associated with the given signposts with signpostName and signpostCategory.
*/
@property (readonly, strong, nonnull) MXHistogram<NSUnitDuration *> *histogrammedSignpostDuration;
/*!
@property cumulativeCPUTime
@abstract Cumulative CPU time aggregated over the MXSignpost intervals.
@discussion This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
*/
@property (readonly, strong, nullable) NSMeasurement<NSUnitDuration *> *cumulativeCPUTime;
/*!
@property averageMemory
@abstract Average value of memory snapshots taken at beginning and end of MXSignpost intervals
@discussion This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
*/
@property (readonly, strong, nullable) MXAverage<NSUnitInformationStorage *> *averageMemory;
/*!
@property cumulativeLogicalWrites
@abstract Cumulative logical writes aggregated over the MXSignpost intervals.
@discussion This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
*/
@property (readonly, strong, nullable) NSMeasurement<NSUnitInformationStorage *> *cumulativeLogicalWrites;
@end
/*!
@class MXSignpostMetric
@abstract An MXMetric subclass that encapsulates signpost metrics.
@discussion Signposts emit using the os_log_t generated by makeLogHandleWithCategory: in MXMetricManger can be flagged for aggregation and reported back in MXMetricPayload.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXSignpostMetric : MXMetric
/*!
@property signpostName
@abstract The name associated with this aggregated signpost.
*/
@property (readonly, strong, nonnull) NSString *signpostName;
/*!
@property signpostCategory
@abstract The category associated with this aggregated signpost.
*/
@property (readonly, strong, nonnull) NSString *signpostCategory;
/*!
@property signpostIntervalData
@abstract A class that encapsulates metrics associated with app specific signpost intervals.
@discussion This property is null when signposts with the associated signpostName and signpostCategory contain no intervals.
*/
@property (readonly, strong, nullable) MXSignpostIntervalData *signpostIntervalData;
/*!
@property totalCount
@abstract The total number of signposts emit with the given signpostName in the aggregation period of the parent payload.
*/
@property (readonly) NSUInteger totalCount;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXMetricPayload.h
//
// MXMetricPayload.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXCPUMetric.h>
#import <MetricKit/MXGPUMetric.h>
#import <MetricKit/MXCellularConditionMetric.h>
#import <MetricKit/MXMetaData.h>
#import <MetricKit/MXAppRunTimeMetric.h>
#import <MetricKit/MXLocationActivityMetric.h>
#import <MetricKit/MXNetworkTransferMetric.h>
#import <MetricKit/MXAppLaunchMetric.h>
#import <MetricKit/MXAppResponsivenessMetric.h>
#import <MetricKit/MXDiskIOMetric.h>
#import <MetricKit/MXMemoryMetric.h>
#import <MetricKit/MXDisplayMetric.h>
#import <MetricKit/MXSignpostMetric.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXMetricPayload
@abstract A wrapper class which contains a metric payload and associated properties of that payload.
@discussion MXMetricPayload encapsulates currently supported metric types that can be vended by MetricKit. MXMetric subclasses on MXMetricPayload are nullable. If an MXMetric subclass is nil, it indicates that the data is not available for this payload.
@discussion MXMetricPayload exposes a convenience function, JSONRepresentation, to convert the contents of the payload to a human readable JSON. This should be used in conjunction with other APIs that accept NSData.
@discussion An MXMetricPayload contains data that covers a 24 hour period of application usage. The properties timeStampBegin and timeStampEnd should be used to determine which time range the payload covers.
@discussion It is possible for an MXMetricPayload to cover regions of time where an application was updated, and thus had multiple different app version strings. The property latestApplicationVersion will always reflect the latest appVersion at the time the metric payload was created. Use includesMultipleApplicationVersions to determine if an application changed versions during the time range the payload covers.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXMetricPayload : NSObject <NSSecureCoding>
/*!
@property latestApplicationVersion
@abstract An NSString representation of the application version from which this payload was generated.
@discussion If the application version was changed during the aggregation of this data, this value will reflect the latest application version at the time of retrieval.
*/
@property (readonly, strong, nonnull) NSString *latestApplicationVersion;
/*!
@property includesMultipleApplicationVersions
@abstract A bool which indicates whether or not this payload contains data from multiple application versions.
@discussion A value of YES indicates that this payload's data reflects multiple application versions.
@discussion A value of NO indicates that this payload only reflects data from the application version specified by latestApplicationVersion.
*/
@property (readonly) BOOL includesMultipleApplicationVersions;
/*!
@property timeStampBegin
@abstract An NSDate object that indicates the time which the payload was generated.
*/
@property (readonly, strong, nonnull) NSDate *timeStampBegin;
/*!
@property timeStampEnd
@abstract An NSDate object that indicates the time which the payload was generated.
*/
@property (readonly, strong, nonnull) NSDate *timeStampEnd;
/*!
@property cpuMetrics
@abstract An object containing CPU metrics for this application.
*/
@property (readonly, strong, nullable) MXCPUMetric *cpuMetrics;
/*!
@property gpuMetrics
@abstract An object containing GPU metrics for this application.
*/
@property (readonly, strong, nullable) MXGPUMetric *gpuMetrics;
/*!
@property cellularConditionMetrics
@abstract An object containing a cellular condition metrics for this application.
*/
@property (readonly, strong, nullable) MXCellularConditionMetric *cellularConditionMetrics;
/*!
@property applicationTimeMetrics
@abstract An object containing running mode metrics for this application.
*/
@property (readonly, strong, nullable) MXAppRunTimeMetric *applicationTimeMetrics;
/*!
@property locationActivityMetrics
@abstract An object containing location activity metrics for this application.
*/
@property (readonly, strong, nullable) MXLocationActivityMetric *locationActivityMetrics;
/*!
@property networkTransferMetrics
@abstract An object containing network transfer metrics for this application.
*/
@property (readonly, strong, nullable) MXNetworkTransferMetric *networkTransferMetrics;
/*!
@property applicationLaunchMetrics
@abstract An object containing launch metrics for this application.
*/
@property (readonly, strong, nullable) MXAppLaunchMetric *applicationLaunchMetrics;
/*!
@property applicationResponsivenessMetrics
@abstract An object containing hang metrics for this application.
*/
@property (readonly, strong, nullable) MXAppResponsivenessMetric *applicationResponsivenessMetrics;
/*!
@property diskIOMetrics
@abstract An object containing disk IO metrics for this application.
*/
@property (readonly, strong, nullable) MXDiskIOMetric *diskIOMetrics;
/*!
@property memoryMetrics
@abstract An object containing memory metrics for this application.
*/
@property (readonly, strong, nullable) MXMemoryMetric *memoryMetrics;
/*!
@property displayMetrics
@abstract An object containing display metrics for this application.
*/
@property (readonly, strong, nullable) MXDisplayMetric *displayMetrics;
/*!
@property signpostMetrics
@abstract An array containing signpost metrics for this application.
*/
@property (readonly, strong, nullable) NSArray<MXSignpostMetric *> *signpostMetrics;
/*!
@property metaData
@abstract An object containing extra metadata for this payload.
*/
@property (readonly, strong, nullable) MXMetaData *metaData;
/*!
@method JSONRepresentation
@abstract Convenience method to return a JSON representation of this payload.
@result An NSData object containing the JSON representation
*/
- (NSData *)JSONRepresentation;
/*!
@method DictionaryRepresentation
@abstract Convenience method to return a NSDictionary representation of this payload.
@result An NSDictionary object containing the dictionary representation
*/
- (NSDictionary *)DictionaryRepresentation;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXCellularConditionMetric.h
//
// MXCellConditionMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXUnit.h>
#import <MetricKit/MXHistogram.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXCellConditionMetric
@abstract An MXMetric subclass that encapsulates cellular condition metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXCellularConditionMetric : MXMetric
/*!
@property cellularConditionTime
@abstract Application run time bucketized by cellular condition.
@discussion This data represents the percentage of time an application spent running in different cellular conditions.
@discussion In the event that no data for any buckets is available, the histogram data will be empty.
@discussion Dimensioned as MXUnitSignalBars.
*/
@property (readonly, strong, nonnull) MXHistogram<MXUnitSignalBars *> *histogrammedCellularConditionTime;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXCPUMetric.h
//
// MXCPUMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
#import <MetricKit/MXMetric.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXCPUMetric
@abstract An MXMetric subclass that encapsulates CPU metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXCPUMetric : MXMetric
/*!
@property cumulativeCPUTime
@abstract CPU time aggregated cumulatively.
@discussion The data here represents the total CPU time an application consumed over the date range of the containing payload.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeCPUTime;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXMetricManager.h
//
// MXMetricManager.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetricPayload.h>
#import <os/log.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
@protocol MXMetricManagerSubscriber;
/*!
@class MXMetricManager
@abstract An instance of this class can be used to retrieve periodic, aggregated power and performance metrics.
@discussion To receive metrics, clients must acquire a reference to the shared instance of the metric manager and add an eligible MXMetricManagerSubscriber.
@discussion Metrics are not guaranteed to be delivered, but can be expected atleast once per day when conditions permit.
@discussion Subscribers to the metric manager can remove themselves using removeSubscriber:subscriber if they no longer wish to receive metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXMetricManager : NSObject
/*!
@property pastPayloads
@abstract A list of past metric payloads received.
*/
@property (readonly, nonnull, strong) NSArray<MXMetricPayload *> *pastPayloads;
/*!
@property sharedManager
@abstract Singleton instance of MXMetricManager.
*/
@property (class, readonly, strong) MXMetricManager *sharedManager;
/*!
@method makeLogHandleWithCategory:category
@abstract Retrieve a log handle for flagging critical sections with os_signpost().
@param category A string used to define a log category
@discussion The log handle configures persistence for any signposts emit while using the log handle.
@result A log handle that can be used with the logging framework.
*/
+ (os_log_t _Nonnull)makeLogHandleWithCategory:(NSString *)category NS_SWIFT_NAME(makeLogHandle(category:));
/*!
@method addSubscriber:subscriber
@abstract Adds a subscriber to the metric manager.
@param subscriber An object that conforms to the MXMetricManagerSubscriber protocol.
@discussion Subscribers can receive metric payloads by conforming to the MXMetricManagerSubscriber protocol.
*/
- (void)addSubscriber:(id<MXMetricManagerSubscriber>)subscriber;
/*!
@method removeSubscriber:subscriber
@abstract Removes a subscriber from the metric manager.
@param subscriber An object that conforms to the MXMetricManagerSubscriber protocol.
@discussion The subscriber indicated, if previously registered, will no longer receive metric payloads.
*/
- (void)removeSubscriber:(id<MXMetricManagerSubscriber>)subscriber;
@end
/*!
@protocol MXMetricManagerSubscriber
@abstract A protocol that allows the conforming object to receive metric payloads from the metric manager.
@discussion In order to receive metric payloads, atleast one object must conform to this protocol and be subscribed to the metric manager.
@discussion Objects which conform to this protocol can be passed to addSubscriber:subscriber and removeSubscriber:subscriber to manage their subscription state.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@protocol MXMetricManagerSubscriber <NSObject>
@required
/*!
@method didReceiveMetricPayloads:payloads
@abstract This method is invoked when a new MXMetricPayload has been received.
@param payloads
An NSArray of MXMetricPayload objects. This array of payloads contains data from previous usage sessions.
@discussion You can expect for this method to be invoked atleast once per day when the app is running and subscribers are available.
@discussion If no subscribers are available, this method will not be invoked.
@discussion Atleast one subscriber must be available to receive metrics.
@discussion This method is invoked on a background queue.
*/
- (void)didReceiveMetricPayloads:(NSArray<MXMetricPayload *> * _Nonnull)payloads;
@optional
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXAverage.h
//
// MXAverage.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXAverage
@abstract A class representing metric data that is averaged.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXAverage<UnitType: NSUnit *> : NSObject <NSSecureCoding>
/*!
@property averageMeasurement
@abstract An NSMeasurement that contains the average measurement.
*/
@property (readonly, strong, nonnull) NSMeasurement<UnitType> *averageMeasurement;
/*!
@property sampleCount
@abstract An NSInteger representation of the number of samples in the distribution used to formulate the average.
@discussion This value is negative if an unknown number of samples was used to compute the average.
*/
@property (readonly) NSInteger sampleCount;
/*!
@property standardDeviation
@abstract An double representation of the standard deviation of the distribution.
@discussion This value is negative an unknown number of samples was used to compute the standard deviation.
*/
@property (readonly) double standardDeviation;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXAppRunTimeMetric.h
//
// MXAppTimeMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
#import <MetricKit/MXMetric.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXAppRunTimeMetric
@abstract An MXMetric subclass that encapsulates app runtime metrics.
@discussion Runtime metrics describe application time spent running in different modes, such as audio, location, etc.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXAppRunTimeMetric : MXMetric
/*!
@property cumulativeForegroundTime
@abstract Cumulative application foreground time.
@discussion Time spent on screen and visible to the user.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeForegroundTime;
/*!
@property cumulativeBackgroundTime
@abstract Cumulative application background time.
@discussion Time spent off screen and in the background, invisible to the user.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeBackgroundTime;
/*!
@property cumulativeBackgroundAudioTime
@abstract Cumulative time the application spent running in the background to play audio
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeBackgroundAudioTime;
/*!
@property cumulativeBackgroundLocationTime
@abstract Cumulative time the application spent running in the background to acquire or process location.
@discussion Dimensioned as NSUnitDuration.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitDuration *> *cumulativeBackgroundLocationTime;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXMemoryMetric.h
//
// MXMemoryMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <MetricKit/MXUnit.h>
#import <os/availability.h>
#import <MetricKit/MXAverage.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXMemoryMetric
@abstract An MXMetric subclass that encapsulates memory metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXMemoryMetric : MXMetric
/*!
@property peakMemoryUsage
@abstract A single value representing the peak memory consumption of the application.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) NSMeasurement<NSUnitInformationStorage *> *peakMemoryUsage;
/*!
@property averageSuspendedMemory
@abstract Average memory of the application upon suspend.
@discussion Dimensioned as NSUnitInformationStorage.
*/
@property (readonly, strong, nonnull) MXAverage<NSUnitInformationStorage *> *averageSuspendedMemory;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXHistogram.h
//
// MXHistogram.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <os/availability.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXHistogramBucket
@abstract A class that represents a bucket within an MXHistogram
@discussion Histogram buckets are sorted in ascending order.
@discussion Histogram bucket start and end values are exclusive.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXHistogramBucket<UnitType: NSUnit *> : NSObject <NSSecureCoding>
/*!
@property bucketStart
@abstract An NSMeasurement representing the start of a histogram bucket.
*/
@property (readonly, strong, nonnull) NSMeasurement<UnitType> *bucketStart;
/*!
@property bucketEnd
@abstract An NSMeasurement representing the end of a histogram bucket.
*/
@property (readonly, strong, nonnull) NSMeasurement<UnitType> *bucketEnd;
/*!
@property bucketCount
@abstract An NSUInteger representing the number of samples in this histogram bucket.
*/
@property (readonly) NSUInteger bucketCount;
@end
/*!
@class MXHistogram
@abstract A class representing bucketized histogram data.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXHistogram<UnitType: NSUnit *> : NSObject <NSSecureCoding>
/*!
@property totalBucketCount
@abstract The number of buckets contained within this histogram.
@discussion This value can never be negative.
*/
@property (readonly) NSUInteger totalBucketCount;
/*!
@property bucketEnumerator
@abstract An NSEnumerator that can be used to enumerate the buckets of this histogram.
*/
@property (readonly, strong, nonnull) NSEnumerator<MXHistogramBucket<UnitType> *> *bucketEnumerator;
@end
NS_ASSUME_NONNULL_END
// ========== MetricKit.framework/Headers/MXAppLaunchMetric.h
//
// MXAppLaunchMetric.h
// MetricKit
//
// Copyright (c) 2018 Apple Inc.
// All rights reserved.
#import <Foundation/Foundation.h>
#import <MetricKit/MXMetric.h>
#import <os/availability.h>
#import <MetricKit/MXHistogram.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MXAppLaunchMetric
@abstract An MXMetric subclass that encapsulates app launch metrics.
*/
API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, tvos, watchos)
@interface MXAppLaunchMetric : MXMetric
/*!
@property histogrammedTimeToFirstDraw
@abstract Histogrammed application time-to-first-draw data.