What's New / App Services, Foundation & Diagnostics

What's new in MetricKit

+107 NewiOS · macOS

MetricKit collects on-device performance metrics and diagnostic reports from an app: CPU time, launch and resume timing, disk and memory usage, and diagnostics for crashes, hangs, and CPU exceptions with attached call stacks.

107 new APIs, no deprecations or removals. New metric structs include CPUTimeMetric, CPUInstructionsCountMetric, ApplicationResumeTimeMetric, BackgroundTerminationMetric, and CellularConditionTimeMetric, plus AverageStatistics. New diagnostic structs include AppLaunchDiagnostic, CPUExceptionDiagnostic, CrashDiagnostic, and DiskWriteExceptionDiagnostic. Call-stack types CallStackFrame, CallStackThread, and CallStackTree are new, along with a DiagnosticReport type carrying a DiagnosticReport.Environment.

New

107
struct

AppLaunchDiagnostic

NewiOSmacOS
public struct AppLaunchDiagnostic : Sendable, Codable

A diagnostic for app launch.

Declaration
public struct AppLaunchDiagnostic : Sendable, Codable {

    /// The application call stack tree associated with the launch issue.
    public let callStackTree: CallStackTree

    /// Duration of the launch that triggered this diagnostic.
    public let launchDuration: Measurement<UnitDuration>
}
extension

AppLaunchDiagnostic

NewiOSmacOS
extension AppLaunchDiagnostic
Declaration
extension AppLaunchDiagnostic {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

ApplicationResumeTimeMetric

NewiOSmacOS
public struct ApplicationResumeTimeMetric : Sendable, Codable, Hashable

A metric for application resume time.

Declaration
public struct ApplicationResumeTimeMetric : Sendable, Codable, Hashable {

    /// Histogram of application resume time durations.
    public let histogram: Histogram<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ApplicationResumeTimeMetric, b: ApplicationResumeTimeMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
extension

Array

NewiOSmacOS
extension Array where Element == MetricReport.StateEntry
Declaration
extension Array where Element == MetricReport.StateEntry {

    /// State entries grouped by their StateReporting domain.
    ///
    /// State entries with active StateReporting context are grouped by their domain.
    public var byStateReportingDomain: [StateReportingDomain : [MetricReport.StateEntry]] { get }
}
extension

Array

NewiOSmacOS
extension Array where Element == MetricReport.IntervalEntry
Declaration
extension Array where Element == MetricReport.IntervalEntry {

    /// The full day interval entry spanning the entire report collection period.
    ///
    /// This entry contains metrics aggregated across the entire aggregation period
    /// while other interval entries represent breakdowns within that period.
    public var fullDayEntry: MetricReport.IntervalEntry { get }

    /// All states from all interval entries grouped by their StateReporting domain.
    public var byStateReportingDomain: [StateReportingDomain : [MetricManager.ReportedState]] { get }
}
struct

AverageStatistics

NewiOSmacOS
public struct AverageStatistics<DimensionType> : Sendable, Codable, Hashable where DimensionType : Dimension

A struct that encapsulates an average value with statistical data.

The average value is always present. The count will be 0 if the number of samples is not available. The standard deviation will be nil if not available.

Declaration
public struct AverageStatistics<DimensionType> : Sendable, Codable, Hashable where DimensionType : Dimension {

    /// The average measurement value.
    public let average: Measurement<DimensionType>

    /// The number of samples used to calculate the average.
    public let count: Int

    /// The standard deviation of the distribution of values used to calculate the average.
    ///
    /// This value is `nil` when the standard deviation is not available.
    public let standardDeviation: Double?

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: AverageStatistics<DimensionType>, b: AverageStatistics<DimensionType>) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

AverageStatistics

NewiOSmacOS
extension AverageStatistics
Declaration
extension AverageStatistics {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

BackgroundTerminationMetric

NewiOSmacOS
public struct BackgroundTerminationMetric : Sendable, Codable, Hashable

A metric for background app terminations.

Declaration
public struct BackgroundTerminationMetric : Sendable, Codable, Hashable {

    /// The number of times the application terminated normally from the background.
    public let normalTerminationCount: Int

    /// The number of times the system terminated the app from the background for using too much memory.
    public let memoryLimitTerminationCount: Int

    /// The number of times the system terminated the app from the background for using too much CPU time.
    public let highCPUTerminationCount: Int

    /// The number of times the system terminated the app from the background to free up memory.
    public let systemPressureTerminationCount: Int

    /// The number of times the system terminated the app from the background for attempting an invalid memory access.
    public let badAccessTerminationCount: Int

    /// The number of times the app terminated abnormally from the background.
    public let abnormalTerminationCount: Int

    /// The number of times the system terminated the app from the background for attempting to execute an illegal or undefined instruction.
    public let illegalInstructionTerminationCount: Int

    /// The number of times the system watchdog terminated the app from the background.
    public let watchdogTerminationCount: Int

    /// The number of times the system terminated the app from the background while being suspended and having file locks.
    public let fileLockTerminationCount: Int

    /// The number of times the system terminated the app from the background for exceeding the allocated time for a background task.
    public let taskTimeoutTerminationCount: Int

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: BackgroundTerminationMetric, b: BackgroundTerminationMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

Truncated.

struct

CallStackFrame

NewiOSmacOS
public struct CallStackFrame : Sendable, Codable, Hashable

Individual call stack frame

Declaration
public struct CallStackFrame : Sendable, Codable, Hashable {

    /// Binary UUID (references CallStackTree.binaryInfo)
    ///
    /// This may be nil if symbolication information is unavailable or the binary is unidentified.
    public let binaryUUID: UUID?

    /// Absolute address
    ///
    /// This may be nil if the address information could not be collected.
    public let address: UInt64?

    /// Offset into binary text segment
    ///
    /// This may be nil if the offset information is unavailable.
    public let offsetIntoBinaryTextSegment: UInt64?

    /// Sample count (for sampled stack traces)
    public let sampleCount: Int?

    /// Sub-frames (children in the call tree)
    public let subFrames: ContiguousArray<CallStackFrame>

    /// Binary name - look up from tree
    ///
    /// - Parameter tree: The call stack tree containing this frame
    /// - Returns: The binary name, or nil if not found
    public func binaryName(from tree: CallStackTree) -> String?

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: CallStackFrame, b: CallStackFrame) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or

Truncated.

struct

CallStackThread

NewiOSmacOS
public struct CallStackThread : Sendable, Codable, Hashable

Individual call stack thread within a call stack tree

Declaration
public struct CallStackThread : Sendable, Codable, Hashable {

    /// Root frames for this call stack thread
    public let rootFrames: ContiguousArray<CallStackFrame>

    /// Indicates whether this call stack is attributed to a specific thread.
    ///
    /// This field is only present when `CallStackTree.callStackPerThread` is `true`.
    public let threadAttributed: Bool?

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: CallStackThread, b: CallStackThread) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

CallStackTree

NewiOSmacOS
public struct CallStackTree : Sendable, Codable, Hashable

Call stack tree structure

Declaration
public struct CallStackTree : Sendable, Codable, Hashable {

    /// Array of call stack threads
    public let callStackThreads: ContiguousArray<CallStackThread>

    /// Whether call stacks are organized per-thread
    public let callStackPerThread: Bool

    /// Deduplicated binary information indexed by UUID
    public let binaryInfo: [UUID : CallStackTree.BinaryInfo]

    /// Metadata for a binary referenced in the call stack
    public struct BinaryInfo : Sendable, Codable, Hashable {

        /// Binary UUID
        public let uuid: UUID

        /// Binary name
        public let name: String

        /// Returns a Boolean value indicating whether two values are equal.
        ///
        /// Equality is the inverse of inequality. For any values `a` and `b`,
        /// `a == b` implies that `a != b` is `false`.
        ///
        /// - Parameters:
        ///   - lhs: A value to compare.
        ///   - rhs: Another value to compare.
        public static func == (a: CallStackTree.BinaryInfo, b: CallStackTree.BinaryInfo) -> Bool

        /// Encodes this value into the given encoder.
        ///
        /// If the value fails to encode anything, `encoder` will encode an empty
        /// keyed container in its place.
        ///
        /// This function throws an error if any values are invalid for the given
        /// encoder's format.
        ///
        /// - Parameter encoder: The encoder to write data to.
        public func encode(to encoder: any Encoder) throws

        /// Hashes the essential components of this value by feeding them into the
        /// given hasher.
        ///
        /// Implement this method to conform to the `Hashable` protocol. The
        /// components used for hashing must be the same as the components compared
        /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
        /// with each of these components.
        ///
        /// - Important: In your implementation of `hash(into:)`,
        ///   don't call `finalize()` on the `hasher` instance provided,
        ///   or replace it with a different instance.
        ///   Doing so may become a compile-time error in the future.
        ///
        /// - Parameter hasher: The hasher to use when combining the components
        ///   of this instance.
        public func hash(into hasher: inout Hasher)

        /// The hash value.
        ///
        /// Hash values are not guaranteed to be equal across different executions of
        /// your program. Do not save hash values to use during a future execution.
        ///
        /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
        ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
        ///   The compiler provides an implementation for `hashValue` for you.
        public var hashValue: Int { get }

        /// Creates a new instance by decoding from the given decoder.
        ///
        /// This initializer throws an error if reading from the decoder fails, or
        /// if the data read is corrupted or otherwise invalid.
        ///
        /// - Parameter decoder: The decoder to read data from.
        public init(from decoder: any Decoder) throws
    }

    /// Iterates all frames efficiently.
    ///
    /// Use this method for optimized traversal of the entire call stack tree.

Truncated.

extension

CallStackTree

NewiOSmacOS
extension CallStackTree
Declaration
extension CallStackTree {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

CellularConditionTimeMetric

NewiOS
public struct CellularConditionTimeMetric : Sendable, Codable, Hashable

A metric for cellular condition time.

Declaration
public struct CellularConditionTimeMetric : Sendable, Codable, Hashable {

    /// Histogram of cellular condition time.
    public let histogram: Histogram<SignalBars>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: CellularConditionTimeMetric, b: CellularConditionTimeMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

CPUExceptionDiagnostic

NewiOSmacOS
public struct CPUExceptionDiagnostic : Sendable, Codable

A diagnostic for a fatal or nonfatal CPU exception.

Declaration
public struct CPUExceptionDiagnostic : Sendable, Codable {

    /// The application call stack tree associated with the excessive CPU consumption.
    public let callStackTree: CallStackTree

    /// Total CPU time consumed in the scope of this CPU exception.
    public let totalCPUTime: Measurement<UnitDuration>

    /// Total time that the application was sampled for during the CPU exception.
    public let totalSampledTime: Measurement<UnitDuration>
}
extension

CPUExceptionDiagnostic

NewiOSmacOS
extension CPUExceptionDiagnostic
Declaration
extension CPUExceptionDiagnostic {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

CPUInstructionsCountMetric

NewiOSmacOS
public struct CPUInstructionsCountMetric : Sendable, Codable, Hashable

A metric for CPU instructions.

Declaration
public struct CPUInstructionsCountMetric : Sendable, Codable, Hashable {

    /// The total number of CPU instructions the app executed during the reporting period.
    public let value: Int

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: CPUInstructionsCountMetric, b: CPUInstructionsCountMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

CPUTimeMetric

NewiOSmacOS
public struct CPUTimeMetric : Sendable, Codable, Hashable

A metric for CPU time.

Declaration
public struct CPUTimeMetric : Sendable, Codable, Hashable {

    /// The total amount of CPU the app used.
    public let value: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: CPUTimeMetric, b: CPUTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

CPUTimeMetric

NewiOSmacOS
extension CPUTimeMetric
Declaration
extension CPUTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

CrashDiagnostic

NewiOSmacOS
public struct CrashDiagnostic : Sendable, Codable

A diagnostic that encapsulates crash reports.

Declaration
public struct CrashDiagnostic : Sendable, Codable {

    /// The application call stack tree associated with this crash.
    public let callStackTree: CallStackTree

    /// The reason the app was terminated as a human-readable string.
    public let terminationReason: CrashDiagnostic.TerminationReason?

    /// Details about memory that the app incorrectly accessed.
    ///
    /// This property is set when a bad memory access crash occurs.
    public let virtualMemoryRegionInfo: String?

    /// The name of the Mach exception that terminated the app.
    public let exceptionType: Int?

    /// Processor specific information about the exception.
    ///
    /// Encoded into one or more 64-bit hexadecimal numbers.
    public let exceptionCode: UInt64?

    /// The signal associated with this crash.
    public let signal: Int?

    /// The exception reason for an uncaught ObjC exception.
    public let exceptionReason: CrashDiagnostic.ObjectiveCExceptionReason?

    /// The category of termination that caused this crash.
    ///
    /// This value corresponds to the termination categories reported by
    /// ``ForegroundTerminationMetric`` and ``BackgroundTerminationMetric``,
    /// enabling correlation between individual crash diagnostics and aggregate
    /// termination counts.
    ///
    /// This property is `nil` when the termination category cannot be determined
    /// from the available crash metadata.
    public let terminationCategory: CrashDiagnostic.TerminationCategory?

    /// A category describing why the system terminated the application.
    ///
    /// Each category corresponds to a termination count property on
    /// ``ForegroundTerminationMetric`` or ``BackgroundTerminationMetric``.
    public struct TerminationCategory : RawRepresentable, Hashable, Sendable, Codable {

        /// The corresponding value of the raw type.
        ///
        /// A new instance initialized with `rawValue` will be equivalent to this
        /// instance. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     let selectedSize = PaperSize.Letter
        ///     print(selectedSize.rawValue)
        ///     // Prints "Letter"
        ///
        ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
        ///     // Prints "true"
        public let rawValue: String

        /// Creates a new instance with the specified raw value.
        ///
        /// If there is no value of the type that corresponds with the specified raw
        /// value, this initializer returns `nil`. For example:
        ///
        ///     enum PaperSize: String {
        ///         case A4, A5, Letter, Legal
        ///     }
        ///
        ///     print(PaperSize(rawValue: "Legal"))
        ///     // Prints "Optional(PaperSize.Legal)"
        ///
        ///     print(PaperSize(rawValue: "Tabloid"))
        ///     // Prints "nil"
        ///
        /// - Parameter rawValue: The raw value to use for the new instance.
        public init(rawValue: String)

        /// The app was terminated for attempting an invalid memory access.

Truncated.

struct

DiagnosticReport

NewiOSmacOS
public struct DiagnosticReport : Sendable, Codable

A report containing a diagnostic event.

Declaration
public struct DiagnosticReport : Sendable, Codable {

    /// Environment context for diagnostic reports.
    public struct Environment : Sendable, Codable {

        /// The short country code for the region format setting of the device.
        public let regionFormat: String

        /// The version of the OS on the device including the type of OS, version number, and build number.
        public let osVersion: OSVersion

        /// The hardware identifier for the device.
        public let deviceType: String

        /// The name of the processor architecture for the device.
        public let platformArchitecture: String

        /// Indicates whether low power mode is enabled on the device.
        public let lowPowerModeEnabled: Bool

        /// Indicates whether the app is registered with TestFlight.
        public let isTestFlightApp: Bool

        /// The value of the bundle version key, short form, in the app's property list.
        public let applicationVersion: String

        /// The value of the bundle version key in the app's property list.
        public let applicationBuildVersion: String

        /// The process ID (PID) of the process.
        public let pid: pid_t?

        /// String representation of the bundle ID of the process.
        public let bundleIdentifier: String

        /// Signpost data associated with the diagnostic.
        @available(visionOS, unavailable)
        public let signpostData: [SignpostRecord]

        /// All states that were active leading up to this diagnostic event.
        ///
        /// This array contains all the StateReporting states that occurred before the diagnostic event.
        /// The array may be empty if no StateReporting context was active.
        @available(visionOS, unavailable)
        public let states: [MetricManager.ReportedState]
    }

    /// The diagnostic result for this report.
    public let result: DiagnosticResult

    /// The date interval this report covers.
    public let timeRange: DateInterval

    /// Environment context for the device and app.
    public let environment: DiagnosticReport.Environment
}
extension

DiagnosticReport

NewiOSmacOS
extension DiagnosticReport
Declaration
extension DiagnosticReport {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
extension

DiagnosticReport.Environment

NewiOSmacOS
extension DiagnosticReport.Environment
Declaration
extension DiagnosticReport.Environment {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
enum

DiagnosticResult

NewiOSmacOS
public enum DiagnosticResult : Sendable, Codable

Enum representing different diagnostic types.

New cases may be added in future OS versions. When switching over this enum, always include an @unknown default case to handle future additions gracefully.

switch diagnosticResult {
case .crash(let diagnostic):
    // Handle crash diagnostic
case .hang(let diagnostic):
    // Handle hang diagnostic
// ... other cases
@unknown default:
    // Handle diagnostics added in future OS versions
    break
}
Declaration
public enum DiagnosticResult : Sendable, Codable {

    case crash(CrashDiagnostic)

    case hang(HangDiagnostic)

    case cpuException(CPUExceptionDiagnostic)

    case diskWriteException(DiskWriteExceptionDiagnostic)

    @available(visionOS, unavailable)
    case appLaunch(AppLaunchDiagnostic)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    @available(visionOS, unavailable)
    case memoryException(MemoryExceptionDiagnostic)

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

DiskWriteExceptionDiagnostic

NewiOSmacOS
public struct DiskWriteExceptionDiagnostic : Sendable, Codable

A diagnostic for a disk write exception.

Declaration
public struct DiskWriteExceptionDiagnostic : Sendable, Codable {

    /// The application call stack tree associated with the excessive disk writes.
    public let callStackTree: CallStackTree

    /// Total bytes written during the exception period.
    public let totalBytesWritten: Measurement<UnitInformationStorage>
}
extension

DiskWriteExceptionDiagnostic

NewiOSmacOS
extension DiskWriteExceptionDiagnostic
Declaration
extension DiskWriteExceptionDiagnostic {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

ExtendedLaunchMetric

NewiOSmacOS
public struct ExtendedLaunchMetric : Sendable, Codable, Hashable

A metric for extended launch.

Declaration
public struct ExtendedLaunchMetric : Sendable, Codable, Hashable {

    /// Histogram of extended launch durations.
    public let histogram: Histogram<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ExtendedLaunchMetric, b: ExtendedLaunchMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

ForegroundTerminationMetric

NewiOSmacOS
public struct ForegroundTerminationMetric : Sendable, Codable, Hashable

A metric for foreground app terminations.

Declaration
public struct ForegroundTerminationMetric : Sendable, Codable, Hashable {

    /// The number of times the application terminated normally from the foreground.
    public let normalTerminationCount: Int

    /// The number of times the system terminated the app from the foreground for using too much memory.
    public let memoryLimitTerminationCount: Int

    /// The number of times the system terminated the app from the foreground for attempting an invalid memory access.
    public let badAccessTerminationCount: Int

    /// The number of times the app terminated abnormally from the foreground.
    public let abnormalTerminationCount: Int

    /// The number of times the system terminated the app from the foreground for attempting to execute an illegal or undefined instruction.
    public let illegalInstructionTerminationCount: Int

    /// The number of times the system watchdog terminated the app from the foreground.
    public let watchdogTerminationCount: Int

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ForegroundTerminationMetric, b: ForegroundTerminationMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

GPUTimeMetric

NewiOSmacOS
public struct GPUTimeMetric : Sendable, Codable, Hashable

A metric for GPU time.

Declaration
public struct GPUTimeMetric : Sendable, Codable, Hashable {

    /// The total amount of GPU time used by the app.
    public let value: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: GPUTimeMetric, b: GPUTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

GPUTimeMetric

NewiOSmacOS
extension GPUTimeMetric
Declaration
extension GPUTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

HangDiagnostic

NewiOSmacOS
public struct HangDiagnostic : Sendable, Codable

A diagnostic for an app that is too busy to handle user input responsively.

Declaration
public struct HangDiagnostic : Sendable, Codable {

    /// The application call stack tree associated with the hang.
    public let callStackTree: CallStackTree

    /// Total hang duration for this diagnostic.
    public let hangDuration: Measurement<UnitDuration>
}
extension

HangDiagnostic

NewiOSmacOS
extension HangDiagnostic
Declaration
extension HangDiagnostic {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

HangTimeMetric

NewiOSmacOS
public struct HangTimeMetric : Sendable, Codable, Hashable

A metric for app hang time.

Declaration
public struct HangTimeMetric : Sendable, Codable, Hashable {

    /// Histogram of application hang time durations.
    public let histogram: Histogram<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: HangTimeMetric, b: HangTimeMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

Histogram

NewiOSmacOS
public struct Histogram<DimensionType> : Sendable, Codable, Hashable where DimensionType : Dimension

A histogram of values.

Declaration
public struct Histogram<DimensionType> : Sendable, Codable, Hashable where DimensionType : Dimension {

    public struct Bucket : Sendable, Codable, Hashable {

        public let lowerBound: Measurement<DimensionType>

        public let upperBound: Measurement<DimensionType>

        public let count: Int

        /// Returns a Boolean value indicating whether two values are equal.
        ///
        /// Equality is the inverse of inequality. For any values `a` and `b`,
        /// `a == b` implies that `a != b` is `false`.
        ///
        /// - Parameters:
        ///   - lhs: A value to compare.
        ///   - rhs: Another value to compare.
        public static func == (a: Histogram<DimensionType>.Bucket, b: Histogram<DimensionType>.Bucket) -> Bool

        /// Hashes the essential components of this value by feeding them into the
        /// given hasher.
        ///
        /// Implement this method to conform to the `Hashable` protocol. The
        /// components used for hashing must be the same as the components compared
        /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
        /// with each of these components.
        ///
        /// - Important: In your implementation of `hash(into:)`,
        ///   don't call `finalize()` on the `hasher` instance provided,
        ///   or replace it with a different instance.
        ///   Doing so may become a compile-time error in the future.
        ///
        /// - Parameter hasher: The hasher to use when combining the components
        ///   of this instance.
        public func hash(into hasher: inout Hasher)

        /// The hash value.
        ///
        /// Hash values are not guaranteed to be equal across different executions of
        /// your program. Do not save hash values to use during a future execution.
        ///
        /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
        ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
        ///   The compiler provides an implementation for `hashValue` for you.
        public var hashValue: Int { get }
    }

    public let buckets: [Histogram<DimensionType>.Bucket]

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: Histogram<DimensionType>, b: Histogram<DimensionType>) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,

Truncated.

extension

Histogram.Bucket

NewiOSmacOS
extension Histogram.Bucket
Declaration
extension Histogram.Bucket {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

HitchTimeMetric

NewiOSmacOS
public struct HitchTimeMetric : Sendable, Codable, Hashable

A metric for hitch time.

Declaration
public struct HitchTimeMetric : Sendable, Codable, Hashable {

    /// Ratio of time the application spent hitching during tracked animations.
    public let ratio: Measurement<Unit>

    /// Total time the application spent hitching during tracked animations.
    public let totalHitchTime: Measurement<UnitDuration>

    /// Total time the application spent animating.
    public let totalAnimationTime: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: HitchTimeMetric, b: HitchTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

HitchTimeMetric

NewiOSmacOS
extension HitchTimeMetric
Declaration
extension HitchTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
init

init

NewiOSmacOS
public init(enabledStateReportingDomains: Set<StateReportingDomain>)

Creates a new MetricManager instance with StateReporting domains enabled for metrics aggregation

Parameters

enabledStateReportingDomains
The StateReporting domains to enable for metrics aggregation. Metrics will be delivered with StateReporting context, broken down by the application states recorded in the specified domains. This manager will receive state entries matching the enabled domains as well as interval entries including the full day aggregate.
struct

LaunchTaskID

NewiOSmacOS
public struct LaunchTaskID : RawRepresentable, Hashable, Sendable, ExpressibleByStringLiteral

The task identifier to track launch measurements.

Declaration
public struct LaunchTaskID : RawRepresentable, Hashable, Sendable, ExpressibleByStringLiteral {

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public let rawValue: String

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init(rawValue: String)

    /// Creates an instance initialized to the given string value.
    ///
    /// - Parameter value: The value of the new instance.
    public init(stringLiteral value: String)

    /// A type that represents an extended grapheme cluster literal.
    ///
    /// Valid types for `ExtendedGraphemeClusterLiteralType` are `Character`,
    /// `String`, and `StaticString`.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)
    @available(visionOS, unavailable)
    public typealias ExtendedGraphemeClusterLiteralType = String

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)
    @available(visionOS, unavailable)
    public typealias RawValue = String

    /// A type that represents a string literal.
    ///
    /// Valid types for `StringLiteralType` are `String` and `StaticString`.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)
    @available(visionOS, unavailable)
    public typealias StringLiteralType = String

    /// A type that represents a Unicode scalar literal.
    ///
    /// Valid types for `UnicodeScalarLiteralType` are `Unicode.Scalar`,
    /// `Character`, `String`, and `StaticString`.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)

Truncated.

struct

LocationActivityTimeMetric

NewiOS
public struct LocationActivityTimeMetric : Sendable, Codable, Hashable

A metric for location activity times.

Declaration
public struct LocationActivityTimeMetric : Sendable, Codable, Hashable {

    /// The total time spent tracking the current location at the best accuracy for navigation.
    public let bestAccuracyForNavigation: Measurement<UnitDuration>

    /// The total time spent tracking the current location at the best accuracy.
    public let bestAccuracy: Measurement<UnitDuration>

    /// The total time spent tracking the current location to an accuracy of 10 meters.
    public let tenMeters: Measurement<UnitDuration>

    /// The total time spent tracking the current location to an accuracy of 100 meters.
    public let oneHundredMeter: Measurement<UnitDuration>

    /// The total time spent tracking the current location to an accuracy of 1 kilometer.
    public let oneKilometer: Measurement<UnitDuration>

    /// The total time spent tracking the current location to an accuracy of 3 kilometers.
    public let threeKilometers: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: LocationActivityTimeMetric, b: LocationActivityTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

LocationActivityTimeMetric

NewiOS
extension LocationActivityTimeMetric
Declaration
extension LocationActivityTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

LogicalDiskWritesMetric

NewiOSmacOS
public struct LogicalDiskWritesMetric : Sendable, Codable, Hashable

A metric for disk writes.

Declaration
public struct LogicalDiskWritesMetric : Sendable, Codable, Hashable {

    /// The total amount of data written to disk or other long term storage.
    public let value: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: LogicalDiskWritesMetric, b: LogicalDiskWritesMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

LogicalDiskWritesMetric

NewiOSmacOS
extension LogicalDiskWritesMetric
Declaration
extension LogicalDiskWritesMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

MemoryExceptionDiagnostic

NewiOS
public struct MemoryExceptionDiagnostic : Sendable, Codable

A diagnostic for a fatal memory exception.

Declaration
public struct MemoryExceptionDiagnostic : Sendable, Codable {

    /// The call stack tree that caused the memory exception.
    public let callStackTree: CallStackTree

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

MetalFrameRateMetric

NewiOSmacOS
public struct MetalFrameRateMetric : Sendable, Codable, Hashable

A metric for Metal frame rate.

Declaration
public struct MetalFrameRateMetric : Sendable, Codable, Hashable {

    /// The frame rate associated with this `CAMetalLayer`
    public let framesPerSecond: Measurement<UnitFrequency>

    /// The total Metal drawable count
    public let frameCount: Int

    /// The duration of time spent actively producing new frames
    public let activeDrawingDuration: Measurement<UnitDuration>

    /// The `CAMetalLayer` name this metric corresponds to
    public let layerName: String

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: MetalFrameRateMetric, b: MetalFrameRateMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

MetalFrameRateMetric

NewiOSmacOS
extension MetalFrameRateMetric
Declaration
extension MetalFrameRateMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

MetricGroup

NewiOSmacOS
public struct MetricGroup : RawRepresentable, Sendable, Codable, Hashable

Categorization system for metrics.

Declaration
public struct MetricGroup : RawRepresentable, Sendable, Codable, Hashable {

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public let rawValue: String

    public static let cpu: MetricGroup

    public static let memory: MetricGroup

    public static let diskIO: MetricGroup

    public static let networkTransfer: MetricGroup

    public static let display: MetricGroup

    public static let animation: MetricGroup

    public static let applicationResponsiveness: MetricGroup

    public static let cellularCondition: MetricGroup

    public static let locationActivity: MetricGroup

    public static let gpu: MetricGroup

    public static let signpost: MetricGroup

    public static let appLaunch: MetricGroup

    public static let appRuntime: MetricGroup

    public static let appTermination: MetricGroup

    public static let diskSpaceUsage: MetricGroup

    public static let frameStatistics: MetricGroup

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)
    @available(visionOS, unavailable)
    public typealias RawValue = String
}
extension

MetricManager

NewiOSmacOS
extension MetricManager
Declaration
extension MetricManager {

    /// Errors that can occur when tracking launch tasks
    public struct LaunchTaskError : Error {

        /// The task ID that caused the error
        public let taskID: LaunchTaskID

        /// The reason for the error
        public let reason: MetricManager.LaunchTaskError.Reason

        /// Reasons for launch task tracking errors
        public enum Reason : Int, Sendable {

            /// The task ID is a null value or exceeds the maximum 128 character length.
            case invalidID

            /// Exceeded the maximum number of tasks.
            case maxCountExceeded

            /// The start call was made too late.
            case pastDeadline

            /// A task with the same ID has already been started.
            case duplicateTask

            /// The task hasn't been started or has already been finished.
            case taskUnknown

            /// Internal failures happened inside the framework.
            case internalFailure

            /// Creates a new instance with the specified raw value.
            ///
            /// If there is no value of the type that corresponds with the specified raw
            /// value, this initializer returns `nil`. For example:
            ///
            ///     enum PaperSize: String {
            ///         case A4, A5, Letter, Legal
            ///     }
            ///
            ///     print(PaperSize(rawValue: "Legal"))
            ///     // Prints "Optional(PaperSize.Legal)"
            ///
            ///     print(PaperSize(rawValue: "Tabloid"))
            ///     // Prints "nil"
            ///
            /// - Parameter rawValue: The raw value to use for the new instance.
            public init?(rawValue: Int)

            /// The raw type that can be used to represent all values of the conforming
            /// type.
            ///
            /// Every distinct value of the conforming type has a corresponding unique
            /// value of the `RawValue` type, but there may be values of the `RawValue`
            /// type that don't have a corresponding value of the conforming type.
            @available(macOS 27.0, iOS 27.0, *)
            @available(tvOS, unavailable)
            @available(watchOS, unavailable)
            @available(visionOS, unavailable)
            public typealias RawValue = Int

            /// The corresponding value of the raw type.
            ///
            /// A new instance initialized with `rawValue` will be equivalent to this
            /// instance. For example:
            ///
            ///     enum PaperSize: String {
            ///         case A4, A5, Letter, Legal
            ///     }
            ///
            ///     let selectedSize = PaperSize.Letter
            ///     print(selectedSize.rawValue)
            ///     // Prints "Letter"
            ///
            ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
            ///     // Prints "true"
            public var rawValue: Int { get }
        }
    }

Truncated.

extension

MetricManager.LaunchTaskError.Reason

NewiOSmacOS
extension MetricManager.LaunchTaskError.Reason : Equatable
Declaration
extension MetricManager.LaunchTaskError.Reason : Equatable {
}
extension

MetricManager.LaunchTaskError.Reason

NewiOSmacOS
extension MetricManager.LaunchTaskError.Reason : Hashable
Declaration
extension MetricManager.LaunchTaskError.Reason : Hashable {
}
extension

MetricManager.LaunchTaskError.Reason

NewiOSmacOS
extension MetricManager.LaunchTaskError.Reason : RawRepresentable
Declaration
extension MetricManager.LaunchTaskError.Reason : RawRepresentable {
}
extension

MetricManager.ReportedState

NewiOSmacOS
extension MetricManager.ReportedState
Declaration
extension MetricManager.ReportedState {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

MetricReport

NewiOSmacOS
public struct MetricReport : Sendable, Codable

A report containing metric data entries collected during the reporting period.

Declaration
public struct MetricReport : Sendable, Codable {

    /// Environment context for metric reports.
    public struct Environment : Sendable, Codable {

        /// The short country code for the region format setting of the device.
        public let regionFormat: String

        /// The version of the OS on the device including the type of OS, version number, and build number.
        public let osVersion: OSVersion

        /// The hardware identifier for the device.
        public let deviceType: String

        /// The name of the processor architecture for the device.
        public let platformArchitecture: String

        /// Indicates whether low power mode is enabled on the device.
        public let lowPowerModeEnabled: Bool

        /// Indicates whether the app is registered with TestFlight.
        public let isTestFlightApp: Bool

        /// String representation of the bundle ID of the process.
        public let bundleIdentifier: String

        /// The value of the bundle version key in the app's property list.
        public let applicationBuildVersion: String

        /// The version of the app on the device at the end of the reporting period.
        public let latestApplicationVersion: String

        /// A Boolean indicating if the version of the app changed at least once during the reporting period.
        public let includesMultipleApplicationVersions: Bool

        /// A Boolean indicating if the number of emitted states exceeded the aggregation limit.
        ///
        /// When `true`, some states may have been omitted from the report. Metrics associated
        /// with the omitted states will be included in the full day interval entry along with non-state-aggregated metrics.
        public let hasExceededStateLimit: Bool

        /// Encodes this value into the given encoder.
        ///
        /// If the value fails to encode anything, `encoder` will encode an empty
        /// keyed container in its place.
        ///
        /// This function throws an error if any values are invalid for the given
        /// encoder's format.
        ///
        /// - Parameter encoder: The encoder to write data to.
        public func encode(to encoder: any Encoder) throws

        /// Creates a new instance by decoding from the given decoder.
        ///
        /// This initializer throws an error if reading from the decoder fails, or
        /// if the data read is corrupted or otherwise invalid.
        ///
        /// - Parameter decoder: The decoder to read data from.
        public init(from decoder: any Decoder) throws
    }

    /// An entry of metric data aggregated by a single StateReporting state.
    public struct StateEntry : Sendable, Codable {

        /// StateReporting information during which this entry was collected.
        public let state: MetricManager.ReportedState

        /// The metric values for this entry.
        public let values: [MetricResult]

        /// Encodes this value into the given encoder.
        ///
        /// If the value fails to encode anything, `encoder` will encode an empty
        /// keyed container in its place.
        ///
        /// This function throws an error if any values are invalid for the given
        /// encoder's format.
        ///
        /// - Parameter encoder: The encoder to write data to.
        public func encode(to encoder: any Encoder) throws

Truncated.

extension

MetricReport

NewiOSmacOS
extension MetricReport
Declaration
extension MetricReport {

    /// Encoding format options for MetricReport.
    public enum EncodingFormat : Sendable {

        /// Default format with state entries and interval entries as arrays.
        ///
        /// State entries are provided as an array, interval entries are provided as an array
        /// with states as arrays within each entry.
        case `default`

        /// Format with entries organized by StateReporting domain.
        ///
        /// State entries are grouped by domain, and interval entries have their states
        /// grouped by domain within each entry.
        case byStateReportingDomain

        /// Returns a Boolean value indicating whether two values are equal.
        ///
        /// Equality is the inverse of inequality. For any values `a` and `b`,
        /// `a == b` implies that `a != b` is `false`.
        ///
        /// - Parameters:
        ///   - lhs: A value to compare.
        ///   - rhs: Another value to compare.
        public static func == (a: MetricReport.EncodingFormat, b: MetricReport.EncodingFormat) -> Bool

        /// Hashes the essential components of this value by feeding them into the
        /// given hasher.
        ///
        /// Implement this method to conform to the `Hashable` protocol. The
        /// components used for hashing must be the same as the components compared
        /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
        /// with each of these components.
        ///
        /// - Important: In your implementation of `hash(into:)`,
        ///   don't call `finalize()` on the `hasher` instance provided,
        ///   or replace it with a different instance.
        ///   Doing so may become a compile-time error in the future.
        ///
        /// - Parameter hasher: The hasher to use when combining the components
        ///   of this instance.
        public func hash(into hasher: inout Hasher)

        /// The hash value.
        ///
        /// Hash values are not guaranteed to be equal across different executions of
        /// your program. Do not save hash values to use during a future execution.
        ///
        /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
        ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
        ///   The compiler provides an implementation for `hashValue` for you.
        public var hashValue: Int { get }
    }

    /// User info key for configuring MetricReport encoding format.
    ///
    /// Use this key with JSONEncoder's userInfo to control how MetricReport is encoded.
    ///
    /// ## Example
    /// ```swift
    /// let encoder = JSONEncoder()
    /// encoder.userInfo[MetricReport.encodingFormatKey] = MetricReport.EncodingFormat.byStateReportingDomain
    /// let jsonData = try encoder.encode(metricReport)
    /// ```
    public static let encodingFormatKey: CodingUserInfoKey
}
extension

MetricReport.EncodingFormat

NewiOSmacOS
extension MetricReport.EncodingFormat : Equatable
Declaration
extension MetricReport.EncodingFormat : Equatable {
}
extension

MetricReport.EncodingFormat

NewiOSmacOS
extension MetricReport.EncodingFormat : Hashable
Declaration
extension MetricReport.EncodingFormat : Hashable {
}
extension

MetricReport.IntervalEntry

NewiOSmacOS
extension MetricReport.IntervalEntry
Declaration
extension MetricReport.IntervalEntry {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
var

metricReports

NewiOSmacOS
final public var metricReports: some AsyncSequence<MetricReport, Never> { get }

Daily metric report

Delivers metric entries that match enabled StateReporting domains as well as non-state-aggregated metric entries.

enum

MetricResult

NewiOSmacOS
public enum MetricResult : Sendable, Codable

Enum representing all possible metric types that can be returned.

New cases may be added in future OS versions. When switching over this enum, always include an @unknown default case to handle future additions gracefully.

switch metricResult {
case .hangTime(let metric):
    // Handle hang time metric
case .cpuTime(let metric):
    // Handle CPU time metric
// ... other cases
@unknown default:
    // Handle metrics added in future OS versions
    break
}
Declaration
public enum MetricResult : Sendable, Codable {

    case hangTime(HangTimeMetric)

    case hitchTime(HitchTimeMetric)

    case scrollHitchTime(ScrollHitchTimeMetric)

    case foregroundTermination(ForegroundTerminationMetric)

    case backgroundTermination(BackgroundTerminationMetric)

    case signpostInterval(SignpostIntervalMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case locationActivityTime(LocationActivityTimeMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case totalForegroundTime(TotalForegroundTimeMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case totalBackgroundTime(TotalBackgroundTimeMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case totalBackgroundAudioTime(TotalBackgroundAudioTimeMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case totalBackgroundLocationTime(TotalBackgroundLocationTimeMetric)

    case cpuTime(CPUTimeMetric)

    case cpuInstructionsCount(CPUInstructionsCountMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case peakMemory(PeakMemoryMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case suspendedMemory(SuspendedMemoryMetric)

    case totalWiFiUpload(TotalWiFiUploadMetric)

    case totalWiFiDownload(TotalWiFiDownloadMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case totalCellularUpload(TotalCellularUploadMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case totalCellularDownload(TotalCellularDownloadMetric)

    case logicalDiskWrites(LogicalDiskWritesMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case pixelLuminance(PixelLuminanceMetric)

    case gpuTime(GPUTimeMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)
    case cellularConditionTime(CellularConditionTimeMetric)

    case timeToFirstDraw(TimeToFirstDrawMetric)

    case applicationResumeTime(ApplicationResumeTimeMetric)

    case optimizedTimeToFirstDraw(OptimizedTimeToFirstDrawMetric)

    case extendedLaunch(ExtendedLaunchMetric)

    @available(macOS, unavailable)
    @available(macCatalyst, unavailable)

Truncated.

extension

MetricResult

NewiOSmacOS
extension MetricResult
Declaration
extension MetricResult {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

OptimizedTimeToFirstDrawMetric

NewiOSmacOS
public struct OptimizedTimeToFirstDrawMetric : Sendable, Codable, Hashable

A metric for optimized time to first draw.

Declaration
public struct OptimizedTimeToFirstDrawMetric : Sendable, Codable, Hashable {

    /// Histogram of optimized time to first draw durations.
    public let histogram: Histogram<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: OptimizedTimeToFirstDrawMetric, b: OptimizedTimeToFirstDrawMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

OSVersion

NewiOSmacOS
public struct OSVersion : Sendable, Codable

The version of the operating system on the device.

Declaration
public struct OSVersion : Sendable, Codable {

    /// The name of the operating system platform (e.g., "iPhone OS").
    public let platform: String

    /// The version number of the operating system (e.g., "26.5").
    public let number: String

    /// The build number of the operating system (e.g., "23F75").
    public let buildNumber: String

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

PeakMemoryMetric

NewiOS
public struct PeakMemoryMetric : Sendable, Codable, Hashable

A metric for peak memory.

Declaration
public struct PeakMemoryMetric : Sendable, Codable, Hashable {

    /// Peak memory footprint.
    public let value: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: PeakMemoryMetric, b: PeakMemoryMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

PeakMemoryMetric

NewiOS
extension PeakMemoryMetric
Declaration
extension PeakMemoryMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

PixelLuminanceMetric

NewiOS
public struct PixelLuminanceMetric : Sendable, Codable, Hashable

A metric for pixel luminance.

Declaration
public struct PixelLuminanceMetric : Sendable, Codable, Hashable {

    /// Average pixel luminance for the application with statistical data.
    public let value: AverageStatistics<AveragePixelLuminance>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: PixelLuminanceMetric, b: PixelLuminanceMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

ScrollHitchTimeMetric

NewiOSmacOS
public struct ScrollHitchTimeMetric : Sendable, Codable, Hashable

A metric for scroll hitch time.

Declaration
public struct ScrollHitchTimeMetric : Sendable, Codable, Hashable {

    /// Ratio of time the application spent hitching while scrolling.
    public let ratio: Measurement<Unit>

    /// Total time the application spent hitching while scrolling.
    public let totalHitchTime: Measurement<UnitDuration>

    /// Total time the application spent scrolling.
    public let totalScrollTime: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: ScrollHitchTimeMetric, b: ScrollHitchTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

ScrollHitchTimeMetric

NewiOSmacOS
extension ScrollHitchTimeMetric
Declaration
extension ScrollHitchTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

SignpostIntervalMetric

NewiOSmacOS
public struct SignpostIntervalMetric : Sendable, Codable, Hashable

A metric for signpost intervals.

Declaration
public struct SignpostIntervalMetric : Sendable, Codable, Hashable {

    /// The developer-specified name of the custom metric represented by the object.
    public let signpostName: String

    /// The developer-specified category of the custom metric represented by the object.
    public let signpostCategory: String

    /// The total number of occurrences of the captured custom metric.
    public let totalCount: Int

    /// A histogram of the different time intervals of a custom metric event.
    public let signpostDuration: Histogram<UnitDuration>

    /// The average memory used during the logged intervals.
    public let averageMemory: AverageStatistics<UnitInformationStorage>?

    /// The total amount of CPU time used during the logged intervals.
    public let cpuTime: Measurement<UnitDuration>?

    /// The total amount of data written to disk or other long term storage during the logged intervals.
    public let logicalWrites: Measurement<UnitInformationStorage>?

    /// The ratio of the total time spent hitching to the total time spent animating during the logged intervals.
    public let hitchTimeRatio: Measurement<Unit>?

    /// The total time spent hitching during the logged intervals.
    public let totalHitchTime: Measurement<UnitDuration>?

    /// The total time spent animating during the logged intervals.
    public let totalAnimationTime: Measurement<UnitDuration>?

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: SignpostIntervalMetric, b: SignpostIntervalMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

SignpostIntervalMetric

NewiOSmacOS
extension SignpostIntervalMetric
Declaration
extension SignpostIntervalMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

SignpostRecord

NewiOSmacOS
public struct SignpostRecord : Sendable, Codable

Signpost record for diagnostics

Declaration
public struct SignpostRecord : Sendable, Codable {

    /// Signpost subsystem
    public let subsystem: String

    /// Signpost category
    public let category: String

    /// Signpost name
    public let name: String

    /// Time interval for the signpost
    /// For instant signposts, start and end are the same (duration == 0)
    public let interval: DateInterval
}
extension

SignpostRecord

NewiOSmacOS
extension SignpostRecord
Declaration
extension SignpostRecord {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

StateReportingDomain

NewiOSmacOS
public struct StateReportingDomain : RawRepresentable, Hashable, Sendable, Codable, ExpressibleByStringLiteral

The reverse-DNS notation StateReporting domain

Declaration
public struct StateReportingDomain : RawRepresentable, Hashable, Sendable, Codable, ExpressibleByStringLiteral {

    /// The corresponding value of the raw type.
    ///
    /// A new instance initialized with `rawValue` will be equivalent to this
    /// instance. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     let selectedSize = PaperSize.Letter
    ///     print(selectedSize.rawValue)
    ///     // Prints "Letter"
    ///
    ///     print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
    ///     // Prints "true"
    public let rawValue: String

    /// Creates a new instance with the specified raw value.
    ///
    /// If there is no value of the type that corresponds with the specified raw
    /// value, this initializer returns `nil`. For example:
    ///
    ///     enum PaperSize: String {
    ///         case A4, A5, Letter, Legal
    ///     }
    ///
    ///     print(PaperSize(rawValue: "Legal"))
    ///     // Prints "Optional(PaperSize.Legal)"
    ///
    ///     print(PaperSize(rawValue: "Tabloid"))
    ///     // Prints "nil"
    ///
    /// - Parameter rawValue: The raw value to use for the new instance.
    public init(rawValue: String)

    /// Creates an instance initialized to the given string value.
    ///
    /// - Parameter value: The value of the new instance.
    public init(stringLiteral value: String)

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// A type that represents an extended grapheme cluster literal.
    ///
    /// Valid types for `ExtendedGraphemeClusterLiteralType` are `Character`,
    /// `String`, and `StaticString`.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)
    @available(visionOS, unavailable)
    public typealias ExtendedGraphemeClusterLiteralType = String

    /// The raw type that can be used to represent all values of the conforming
    /// type.
    ///
    /// Every distinct value of the conforming type has a corresponding unique
    /// value of the `RawValue` type, but there may be values of the `RawValue`
    /// type that don't have a corresponding value of the conforming type.
    @available(macOS 27.0, iOS 27.0, *)
    @available(tvOS, unavailable)
    @available(watchOS, unavailable)

Truncated.

extension

StateReportingDomain

NewiOSmacOS
extension StateReportingDomain : CodingKeyRepresentable
Declaration
extension StateReportingDomain : CodingKeyRepresentable {

    public init?<T>(codingKey: T) where T : CodingKey

    public var codingKey: any CodingKey { get }
}
struct

SuspendedMemoryMetric

NewiOS
public struct SuspendedMemoryMetric : Sendable, Codable, Hashable

A metric for suspended memory.

Declaration
public struct SuspendedMemoryMetric : Sendable, Codable, Hashable {

    /// Average suspended memory footprint with statistical data.
    public let value: AverageStatistics<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: SuspendedMemoryMetric, b: SuspendedMemoryMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TimeToFirstDrawMetric

NewiOSmacOS
public struct TimeToFirstDrawMetric : Sendable, Codable, Hashable

A metric for time to first draw.

Declaration
public struct TimeToFirstDrawMetric : Sendable, Codable, Hashable {

    /// Histogram of time to first draw durations.
    public let histogram: Histogram<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TimeToFirstDrawMetric, b: TimeToFirstDrawMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalBackgroundAudioTimeMetric

NewiOS
public struct TotalBackgroundAudioTimeMetric : Sendable, Codable, Hashable

A metric for total background audio time.

Declaration
public struct TotalBackgroundAudioTimeMetric : Sendable, Codable, Hashable {

    /// The total time the app is in the background and playing audio.
    public let value: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalBackgroundAudioTimeMetric, b: TotalBackgroundAudioTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalBackgroundAudioTimeMetric

NewiOS
extension TotalBackgroundAudioTimeMetric
Declaration
extension TotalBackgroundAudioTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalBackgroundLocationTimeMetric

NewiOS
public struct TotalBackgroundLocationTimeMetric : Sendable, Codable, Hashable

A metric for total background location time.

Declaration
public struct TotalBackgroundLocationTimeMetric : Sendable, Codable, Hashable {

    /// The total time the app is in the background and using location services.
    public let value: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalBackgroundLocationTimeMetric, b: TotalBackgroundLocationTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalBackgroundLocationTimeMetric

NewiOS
extension TotalBackgroundLocationTimeMetric
Declaration
extension TotalBackgroundLocationTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalBackgroundTimeMetric

NewiOS
public struct TotalBackgroundTimeMetric : Sendable, Codable, Hashable

A metric for total background time.

Declaration
public struct TotalBackgroundTimeMetric : Sendable, Codable, Hashable {

    /// The total time the app is active in the background.
    public let value: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalBackgroundTimeMetric, b: TotalBackgroundTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalBackgroundTimeMetric

NewiOS
extension TotalBackgroundTimeMetric
Declaration
extension TotalBackgroundTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalCellularDownloadMetric

NewiOS
public struct TotalCellularDownloadMetric : Sendable, Codable, Hashable

A metric for total cellular download.

Declaration
public struct TotalCellularDownloadMetric : Sendable, Codable, Hashable {

    /// The total amount of data downloaded over the cellular connection.
    public let value: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalCellularDownloadMetric, b: TotalCellularDownloadMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalCellularDownloadMetric

NewiOS
extension TotalCellularDownloadMetric
Declaration
extension TotalCellularDownloadMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalCellularUploadMetric

NewiOS
public struct TotalCellularUploadMetric : Sendable, Codable, Hashable

A metric for total cellular upload.

Declaration
public struct TotalCellularUploadMetric : Sendable, Codable, Hashable {

    /// The total amount of data uploaded over the cellular connection.
    public let value: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalCellularUploadMetric, b: TotalCellularUploadMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalCellularUploadMetric

NewiOS
extension TotalCellularUploadMetric
Declaration
extension TotalCellularUploadMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalDiskSpaceCapacityMetric

NewiOS
public struct TotalDiskSpaceCapacityMetric : Sendable, Codable, Hashable

A metric for disk space capacity.

Declaration
public struct TotalDiskSpaceCapacityMetric : Sendable, Codable, Hashable {

    /// The total disk space capacity of the current device.
    public let capacity: Measurement<UnitInformationStorage>

    /// The total amount of used disk storage on the current device.
    public let spaceUsed: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalDiskSpaceCapacityMetric, b: TotalDiskSpaceCapacityMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalDiskSpaceCapacityMetric

NewiOS
extension TotalDiskSpaceCapacityMetric
Declaration
extension TotalDiskSpaceCapacityMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalFileCountMetric

NewiOS
public struct TotalFileCountMetric : Sendable, Codable, Hashable

A metric for total file counts.

Declaration
public struct TotalFileCountMetric : Sendable, Codable, Hashable {

    /// The total number of your app's binary files.
    public let binaryFileCount: Int

    /// The total number of data files in your app's container(s).
    public let dataFileCount: Int

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalFileCountMetric, b: TotalFileCountMetric) -> Bool

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalFileSizeMetric

NewiOS
public struct TotalFileSizeMetric : Sendable, Codable, Hashable

A metric for total file sizes.

Declaration
public struct TotalFileSizeMetric : Sendable, Codable, Hashable {

    /// The total size of disk space your app's binary files occupy.
    public let binaryFileSize: Measurement<UnitInformationStorage>

    /// The total size of your application's cache folder.
    public let cacheFolderSize: Measurement<UnitInformationStorage>

    /// The total size of all clone files that are attributed to your app.
    public let cloneSize: Measurement<UnitInformationStorage>

    /// The total size of disk space your app uses for storing data files.
    public let dataFileSize: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalFileSizeMetric, b: TotalFileSizeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalFileSizeMetric

NewiOS
extension TotalFileSizeMetric
Declaration
extension TotalFileSizeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalForegroundTimeMetric

NewiOS
public struct TotalForegroundTimeMetric : Sendable, Codable, Hashable

A metric for total foreground time.

Declaration
public struct TotalForegroundTimeMetric : Sendable, Codable, Hashable {

    /// The total time the app is in the foreground.
    public let value: Measurement<UnitDuration>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalForegroundTimeMetric, b: TotalForegroundTimeMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalForegroundTimeMetric

NewiOS
extension TotalForegroundTimeMetric
Declaration
extension TotalForegroundTimeMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalWiFiDownloadMetric

NewiOSmacOS
public struct TotalWiFiDownloadMetric : Sendable, Codable, Hashable

A metric for total WiFi download.

Declaration
public struct TotalWiFiDownloadMetric : Sendable, Codable, Hashable {

    /// The total amount of data downloaded over the WiFi connection.
    public let value: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalWiFiDownloadMetric, b: TotalWiFiDownloadMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalWiFiDownloadMetric

NewiOSmacOS
extension TotalWiFiDownloadMetric
Declaration
extension TotalWiFiDownloadMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
struct

TotalWiFiUploadMetric

NewiOSmacOS
public struct TotalWiFiUploadMetric : Sendable, Codable, Hashable

A metric for total WiFi upload.

Declaration
public struct TotalWiFiUploadMetric : Sendable, Codable, Hashable {

    /// The total amount of data uploaded over the WiFi connection.
    public let value: Measurement<UnitInformationStorage>

    /// Returns a Boolean value indicating whether two values are equal.
    ///
    /// Equality is the inverse of inequality. For any values `a` and `b`,
    /// `a == b` implies that `a != b` is `false`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func == (a: TotalWiFiUploadMetric, b: TotalWiFiUploadMetric) -> Bool

    /// Hashes the essential components of this value by feeding them into the
    /// given hasher.
    ///
    /// Implement this method to conform to the `Hashable` protocol. The
    /// components used for hashing must be the same as the components compared
    /// in your type's `==` operator implementation. Call `hasher.combine(_:)`
    /// with each of these components.
    ///
    /// - Important: In your implementation of `hash(into:)`,
    ///   don't call `finalize()` on the `hasher` instance provided,
    ///   or replace it with a different instance.
    ///   Doing so may become a compile-time error in the future.
    ///
    /// - Parameter hasher: The hasher to use when combining the components
    ///   of this instance.
    public func hash(into hasher: inout Hasher)

    /// The hash value.
    ///
    /// Hash values are not guaranteed to be equal across different executions of
    /// your program. Do not save hash values to use during a future execution.
    ///
    /// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
    ///   conform to `Hashable`, implement the `hash(into:)` requirement instead.
    ///   The compiler provides an implementation for `hashValue` for you.
    public var hashValue: Int { get }
}
extension

TotalWiFiUploadMetric

NewiOSmacOS
extension TotalWiFiUploadMetric
Declaration
extension TotalWiFiUploadMetric {

    /// Encodes this value into the given encoder.
    ///
    /// If the value fails to encode anything, `encoder` will encode an empty
    /// keyed container in its place.
    ///
    /// This function throws an error if any values are invalid for the given
    /// encoder's format.
    ///
    /// - Parameter encoder: The encoder to write data to.
    public func encode(to encoder: any Encoder) throws

    /// Creates a new instance by decoding from the given decoder.
    ///
    /// This initializer throws an error if reading from the decoder fails, or
    /// if the data read is corrupted or otherwise invalid.
    ///
    /// - Parameter decoder: The decoder to read data from.
    public init(from decoder: any Decoder) throws
}
typealias

CrashDiagnostic.TerminationCategory.RawValue

NewiOSmacOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

CrashDiagnostic.TerminationReason.RawValue

NewiOSmacOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

LaunchTaskID.ExtendedGraphemeClusterLiteralType

NewiOSmacOS
public typealias ExtendedGraphemeClusterLiteralType = String

A type that represents an extended grapheme cluster literal.

Valid types for ExtendedGraphemeClusterLiteralType are Character, String, and StaticString.

typealias

LaunchTaskID.RawValue

NewiOSmacOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

LaunchTaskID.StringLiteralType

NewiOSmacOS
public typealias StringLiteralType = String

A type that represents a string literal.

Valid types for StringLiteralType are String and StaticString.

typealias

LaunchTaskID.UnicodeScalarLiteralType

NewiOSmacOS
public typealias UnicodeScalarLiteralType = String

A type that represents a Unicode scalar literal.

Valid types for UnicodeScalarLiteralType are Unicode.Scalar, Character, String, and StaticString.

typealias

MetricGroup.RawValue

NewiOSmacOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

MetricManager.LaunchTaskError.Reason.RawValue

NewiOSmacOS
public typealias RawValue = Int

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

StateReportingDomain.ExtendedGraphemeClusterLiteralType

NewiOSmacOS
public typealias ExtendedGraphemeClusterLiteralType = String

A type that represents an extended grapheme cluster literal.

Valid types for ExtendedGraphemeClusterLiteralType are Character, String, and StaticString.

typealias

StateReportingDomain.RawValue

NewiOSmacOS
public typealias RawValue = String

The raw type that can be used to represent all values of the conforming type.

Every distinct value of the conforming type has a corresponding unique value of the RawValue type, but there may be values of the RawValue type that don't have a corresponding value of the conforming type.

typealias

StateReportingDomain.StringLiteralType

NewiOSmacOS
public typealias StringLiteralType = String

A type that represents a string literal.

Valid types for StringLiteralType are String and StaticString.

typealias

StateReportingDomain.UnicodeScalarLiteralType

NewiOSmacOS
public typealias UnicodeScalarLiteralType = String

A type that represents a Unicode scalar literal.

Valid types for UnicodeScalarLiteralType are Unicode.Scalar, Character, String, and StaticString.

No APIs match your filter.

← More in App Services, Foundation & Diagnostics