<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit/AverageStatistics",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "s:9MetricKit17AverageStatisticsV"
  },
  "title" : "AverageStatistics"
}
-->

# AverageStatistics

A value that encapsulates an average measurement with supporting statistical data.

```
struct AverageStatistics<DimensionType> where DimensionType : Dimension
```

## Discussion

`AverageStatistics` provides the average value alongside a sample count and standard deviation. When statistical data is unavailable, `count` is `0` and `standardDeviation` is negative.

You encounter `AverageStatistics` as the type of certain metric properties, such as [`value`](/documentation/MetricKit/SuspendedMemoryMetric/value) and [`averageMemory`](/documentation/MetricKit/SignpostIntervalMetric/averageMemory):

```swift
let statistics = metric.value // AverageStatistics<UnitInformationStorage>
print(statistics.average)           // Measurement<UnitInformationStorage>
print(statistics.count)             // Int — number of samples
print(statistics.standardDeviation) // Double — negative if unavailable
```

## Topics

### Statistics

[`let average: Measurement<DimensionType>`](/documentation/MetricKit/AverageStatistics/average)

The average measurement value.

[`let count: Int`](/documentation/MetricKit/AverageStatistics/count)

The number of samples used to calculate the average.

[`let standardDeviation: Double?`](/documentation/MetricKit/AverageStatistics/standardDeviation)

The standard deviation of the distribution of values used to calculate the average.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)