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
24extern_conformance!(
25    unsafe impl NSCoding for MXSignpostIntervalData {}
26);
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for MXSignpostIntervalData {}
30);
31
32extern_conformance!(
33    unsafe impl NSSecureCoding for MXSignpostIntervalData {}
34);
35
36impl MXSignpostIntervalData {
37    extern_methods!(
38        #[cfg(feature = "MXHistogram")]
39        /// A histogram of signpost intervals durations associated with the given signposts with signpostName and signpostCategory.
40        #[unsafe(method(histogrammedSignpostDuration))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn histogrammedSignpostDuration(&self) -> Retained<MXHistogram<NSUnitDuration>>;
43
44        /// Cumulative CPU time aggregated over the MXSignpost intervals.
45        ///
46        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
47        #[unsafe(method(cumulativeCPUTime))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn cumulativeCPUTime(&self) -> Option<Retained<NSMeasurement<NSUnitDuration>>>;
50
51        #[cfg(feature = "MXAverage")]
52        /// Average value of memory snapshots taken at beginning and end of MXSignpost intervals
53        ///
54        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
55        #[unsafe(method(averageMemory))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn averageMemory(&self)
58            -> Option<Retained<MXAverage<NSUnitInformationStorage>>>;
59
60        /// Cumulative logical writes aggregated over the MXSignpost intervals.
61        ///
62        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
63        #[unsafe(method(cumulativeLogicalWrites))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn cumulativeLogicalWrites(
66            &self,
67        ) -> Option<Retained<NSMeasurement<NSUnitInformationStorage>>>;
68
69        /// Cumulative hitch time ratio aggregated over the MXSignpostAnimation intervals.
70        ///
71        /// This property is null when signposts with the associated signpostName and signpostCategory contain no interval metric data.
72        #[unsafe(method(cumulativeHitchTimeRatio))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn cumulativeHitchTimeRatio(&self) -> Option<Retained<NSMeasurement<NSUnit>>>;
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79impl MXSignpostIntervalData {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}
90
91extern_class!(
92    /// An MXMetric subclass that encapsulates signpost metrics.
93    ///
94    /// Signposts emit using the os_log_t generated by makeLogHandleWithCategory: in MXMetricManger can be flagged for aggregation and reported back in MXMetricPayload.
95    ///
96    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxsignpostmetric?language=objc)
97    #[unsafe(super(MXMetric, NSObject))]
98    #[derive(Debug, PartialEq, Eq, Hash)]
99    #[cfg(feature = "MXMetric")]
100    pub struct MXSignpostMetric;
101);
102
103#[cfg(feature = "MXMetric")]
104extern_conformance!(
105    unsafe impl NSCoding for MXSignpostMetric {}
106);
107
108#[cfg(feature = "MXMetric")]
109extern_conformance!(
110    unsafe impl NSObjectProtocol for MXSignpostMetric {}
111);
112
113#[cfg(feature = "MXMetric")]
114extern_conformance!(
115    unsafe impl NSSecureCoding for MXSignpostMetric {}
116);
117
118#[cfg(feature = "MXMetric")]
119impl MXSignpostMetric {
120    extern_methods!(
121        /// The name associated with this aggregated signpost.
122        #[unsafe(method(signpostName))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn signpostName(&self) -> Retained<NSString>;
125
126        /// The category associated with this aggregated signpost.
127        #[unsafe(method(signpostCategory))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn signpostCategory(&self) -> Retained<NSString>;
130
131        /// A class that encapsulates metrics associated with app specific signpost intervals.
132        ///
133        /// This property is null when signposts with the associated signpostName and signpostCategory contain no intervals.
134        #[unsafe(method(signpostIntervalData))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn signpostIntervalData(&self) -> Option<Retained<MXSignpostIntervalData>>;
137
138        /// The total number of signposts emit with the given signpostName in the aggregation period of the parent payload.
139        #[unsafe(method(totalCount))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn totalCount(&self) -> NSUInteger;
142    );
143}
144
145/// Methods declared on superclass `NSObject`.
146#[cfg(feature = "MXMetric")]
147impl MXSignpostMetric {
148    extern_methods!(
149        #[unsafe(method(init))]
150        #[unsafe(method_family = init)]
151        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
152
153        #[unsafe(method(new))]
154        #[unsafe(method_family = new)]
155        pub unsafe fn new() -> Retained<Self>;
156    );
157}