Statistic
public struct Statistic : Codable
The Statistic struct represents the enclosing structure of statistics
returning from the various stat API calls. It contains the
date of the aggregated time period, along with the raw stats.
-
The date for this statistic set.
Declaration
Swift
public let date: Date -
The individual stat samples that make up this collection.
Declaration
Swift
public let stats: [Statistic.Sample]
-
Initializes the struct.
Declaration
Swift
public init(date: Date, stats: [Statistic.Sample])Parameters
dateThe date for this statistic set.
statsThe individual stat samples that make up this collection.
-
The
See moreStatistic.Metricstruct represents the raw statistics for a given time period.Declaration
Swift
struct Metric : Codable
-
The
See moreStatistic.Samplestruct represents a single group of statistics, with the raw stats being made available via themetricsproperty.Declaration
Swift
struct Sample : Codable
-
Represents the various aggregation methods a stats call can have.
- day: Statistic aggregated by day.
- week: Statistics aggregated by week.
- month: Statistics aggregated by month.
Declaration
Swift
enum Aggregation : String, Codable
View on GitHub
Statistic Structure Reference