objc2_metric_kit/generated/
MXSignpostMetric.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// A class that encapsulates metrics associated with app specific signpost intervals.
11    ///
12    /// These metrics will be collected and aggregated if the associated signposts were emit using MXSignpost or MXSignpostAnimation APIs
13    ///
14    /// To limit on-device overhead, the system will automatically limit the number of signposts (emitted using the MetricKit log handle) processed.
15    ///
16    /// Avoid losing telemetry by limiting usage of signposts (emitted using the MetricKit log handle) to critical sections of code.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxsignpostintervaldata?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    pub struct MXSignpostIntervalData;
22);
23
24unsafe impl NSCoding for MXSignpostIntervalData {}
25
26unsafe impl NSObjectProtocol for MXSignpostIntervalData {}
27
28unsafe impl NSSecureCoding for MXSignpostIntervalData {}
29
30impl MXSignpostIntervalData {
31    extern_methods!(
32        #[cfg(feature = "MXHistogram")]
33        /// A histogram of signpost intervals durations associated with the given signposts with signpostName and signpostCategory.
34        #[unsafe(method(histogrammedSignpostDuration))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn histogrammedSignpostDuration(&self) -> Retained<MXHistogram<NSUnitDuration>>;
37
38        /// Cumulative CPU time aggregated over the MXSignpost intervals.
39        ///
40        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
41        #[unsafe(method(cumulativeCPUTime))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn cumulativeCPUTime(&self) -> Option<Retained<NSMeasurement<NSUnitDuration>>>;
44
45        #[cfg(feature = "MXAverage")]
46        /// Average value of memory snapshots taken at beginning and end of MXSignpost intervals
47        ///
48        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
49        #[unsafe(method(averageMemory))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn averageMemory(&self)
52            -> Option<Retained<MXAverage<NSUnitInformationStorage>>>;
53
54        /// Cumulative logical writes aggregated over the MXSignpost intervals.
55        ///
56        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
57        #[unsafe(method(cumulativeLogicalWrites))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn cumulativeLogicalWrites(
60            &self,
61        ) -> Option<Retained<NSMeasurement<NSUnitInformationStorage>>>;
62
63        /// Cumulative hitch time ratio aggregated over the MXSignpostAnimation intervals.
64        ///
65        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
66        #[unsafe(method(cumulativeHitchTimeRatio))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn cumulativeHitchTimeRatio(&self) -> Option<Retained<NSMeasurement<NSUnit>>>;
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73impl MXSignpostIntervalData {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}
84
85extern_class!(
86    /// An MXMetric subclass that encapsulates signpost metrics.
87    ///
88    /// Signposts emit using the os_log_t generated by makeLogHandleWithCategory: in MXMetricManger can be flagged for aggregation and reported back in MXMetricPayload.
89    ///
90    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxsignpostmetric?language=objc)
91    #[unsafe(super(MXMetric, NSObject))]
92    #[derive(Debug, PartialEq, Eq, Hash)]
93    #[cfg(feature = "MXMetric")]
94    pub struct MXSignpostMetric;
95);
96
97#[cfg(feature = "MXMetric")]
98unsafe impl NSCoding for MXSignpostMetric {}
99
100#[cfg(feature = "MXMetric")]
101unsafe impl NSObjectProtocol for MXSignpostMetric {}
102
103#[cfg(feature = "MXMetric")]
104unsafe impl NSSecureCoding for MXSignpostMetric {}
105
106#[cfg(feature = "MXMetric")]
107impl MXSignpostMetric {
108    extern_methods!(
109        /// The name associated with this aggregated signpost.
110        #[unsafe(method(signpostName))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn signpostName(&self) -> Retained<NSString>;
113
114        /// The category associated with this aggregated signpost.
115        #[unsafe(method(signpostCategory))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn signpostCategory(&self) -> Retained<NSString>;
118
119        /// A class that encapsulates metrics associated with app specific signpost intervals.
120        ///
121        /// This property is null when signposts with the associated signpostName and signpostCategory contain no intervals.
122        #[unsafe(method(signpostIntervalData))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn signpostIntervalData(&self) -> Option<Retained<MXSignpostIntervalData>>;
125
126        /// The total number of signposts emit with the given signpostName in the aggregation period of the parent payload.
127        #[unsafe(method(totalCount))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn totalCount(&self) -> NSUInteger;
130    );
131}
132
133/// Methods declared on superclass `NSObject`.
134#[cfg(feature = "MXMetric")]
135impl MXSignpostMetric {
136    extern_methods!(
137        #[unsafe(method(init))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140
141        #[unsafe(method(new))]
142        #[unsafe(method_family = new)]
143        pub unsafe fn new() -> Retained<Self>;
144    );
145}