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
pagePage to fetch.
perNumer of rows per page
eventLoopEventloop 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
fromStart of date range, inclusive.
toEnd of date range, inclusive.
eventLoopEventloop 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
dayDate to calculate
eventLoopEventloop 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
dayDate to calculate
eventLoopEventloop 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
fromStart of date range, inclusive.
toEnd of date range, inclusive.
eventLoopEventloop to use
-
Calculates and returns build time information for a given day
Declaration
Swift
func getBuildTime(day: Date, using eventLoop: EventLoop) -> EventLoopFuture<DayBuildTime>Parameters
dayDate to calculate
eventLoopEventloop to use
-
Calculates and stores build time information for a given day
Declaration
Swift
func createDayBuildTime(day: Date, using eventLoop: EventLoop) -> EventLoopFuture<Void>Parameters
dayDate to calculate
eventLoopEventloop to use