StatisticsRepository

public protocol StatisticsRepository

Repository to insert and query statistics

  • Fetches build statuses, sorted by date descending

    Declaration

    Swift

    func getBuildStatuses(page: Int, per: Int, using eventLoop: EventLoop) -> EventLoopFuture<Page<BuildStatusResult>>

    Parameters

    page

    Page to fetch.

    per

    Numer of rows per page

    eventLoop

    Eventloop to use

  • Fetches counts for a date range, sorted by date

    Declaration

    Swift

    func getDayCounts(from: Date, to: Date, using eventLoop: EventLoop) -> EventLoopFuture<[DayCount]>

    Parameters

    from

    Start of date range, inclusive.

    to

    End of date range, inclusive.

    eventLoop

    Eventloop to use

  • Calculates and returns number of builds and errors for a given day

    Declaration

    Swift

    func getCount(day: Date, using eventLoop: EventLoop) -> EventLoopFuture<DayCount>

    Parameters

    day

    Date to calculate

    eventLoop

    Eventloop to use

  • Calculates and stores number of builds and errors for a given day

    Declaration

    Swift

    func createDayCount(day: Date, using eventLoop: EventLoop) -> EventLoopFuture<Void>

    Parameters

    day

    Date to calculate

    eventLoop

    Eventloop to use

  • Fetches build times for a date range, sorted by date

    Declaration

    Swift

    func getDayBuildTimes(from: Date, to: Date, using eventLoop: EventLoop) -> EventLoopFuture<[DayBuildTime]>

    Parameters

    from

    Start of date range, inclusive.

    to

    End of date range, inclusive.

    eventLoop

    Eventloop to use

  • Calculates and returns build time information for a given day

    Declaration

    Swift

    func getBuildTime(day: Date, using eventLoop: EventLoop) -> EventLoopFuture<DayBuildTime>

    Parameters

    day

    Date to calculate

    eventLoop

    Eventloop to use

  • Calculates and stores build time information for a given day

    Declaration

    Swift

    func createDayBuildTime(day: Date, using eventLoop: EventLoop) -> EventLoopFuture<Void>

    Parameters

    day

    Date to calculate

    eventLoop

    Eventloop to use