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

    date

    The date for this statistic set.

    stats

    The individual stat samples that make up this collection.

  • The Statistic.Metric struct represents the raw statistics for a given time period.

    See more

    Declaration

    Swift

    struct Metric : Codable
  • The Statistic.Sample struct represents a single group of statistics, with the raw stats being made available via the metrics property.

    See more

    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.
    See more

    Declaration

    Swift

    enum Aggregation : String, Codable
  • The Statistic.Dimension enum represents the different ways the statistics can be sliced.

    • category: Represents statistics grouped by category.
    • subuser: Represents statistics grouped by subuser.
    See more

    Declaration

    Swift

    enum Dimension : String, Codable