Remove data point calucations for now
This commit is contained in:
@@ -263,20 +263,20 @@ struct StatsController: RouteCollection {
|
|||||||
// print ( Date().timeIntervalSince(startTime))
|
// print ( Date().timeIntervalSince(startTime))
|
||||||
|
|
||||||
|
|
||||||
let cumulativeWinLossRatios = self.getCumulativeWinLossRatios(matches: matches)
|
// let cumulativeWinLossRatios = self.getCumulativeWinLossRatios(matches: matches)
|
||||||
|
|
||||||
// print ( Date().timeIntervalSince(startTime))
|
// print ( Date().timeIntervalSince(startTime))
|
||||||
|
|
||||||
let highestWinLossRatio = cumulativeWinLossRatios.reduce("0") { (highestRatio, dataPoint) -> String in
|
// let highestWinLossRatio = cumulativeWinLossRatios.reduce("0") { (highestRatio, dataPoint) -> String in
|
||||||
if dataPoint.y > Double(highestRatio)!{
|
// if dataPoint.y > Double(highestRatio)!{
|
||||||
return String(dataPoint.y)
|
// return String(dataPoint.y)
|
||||||
}
|
// }
|
||||||
return highestRatio
|
// return highestRatio
|
||||||
}
|
// }
|
||||||
// print ( Date().timeIntervalSince(startTime))
|
// print ( Date().timeIntervalSince(startTime))
|
||||||
|
|
||||||
|
|
||||||
return AllStats.init(overall: overallStats,mwStats: mwStats, bocwStats: bocwStats, byMonth: monthlyStats, highestWinLossRatio: highestWinLossRatio, dataPoints: cumulativeWinLossRatios, mostRecentRecord: "\(mostRecentDailyStats.totalWins) - \(mostRecentDailyStats.totalLosses)")
|
return AllStats.init(overall: overallStats,mwStats: mwStats, bocwStats: bocwStats, byMonth: monthlyStats, mostRecentRecord: "\(mostRecentDailyStats.totalWins) - \(mostRecentDailyStats.totalLosses)")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,15 +29,11 @@ final class AllStats: Content {
|
|||||||
var mwStats:StatsWithMostRecentDailyRecord
|
var mwStats:StatsWithMostRecentDailyRecord
|
||||||
var bocwStats:StatsWithMostRecentDailyRecord
|
var bocwStats:StatsWithMostRecentDailyRecord
|
||||||
var byMonth: [MonthStats]
|
var byMonth: [MonthStats]
|
||||||
var highestWinLossRatio:String
|
|
||||||
var dataPoints:[DataPoint]
|
|
||||||
var mostRecentRecord:String
|
var mostRecentRecord:String
|
||||||
|
|
||||||
init( overall:StatsWithMostRecentDailyRecord, mwStats:StatsWithMostRecentDailyRecord, bocwStats:StatsWithMostRecentDailyRecord, byMonth:[MonthStats], highestWinLossRatio:String, dataPoints:[DataPoint], mostRecentRecord:String) {
|
init( overall:StatsWithMostRecentDailyRecord, mwStats:StatsWithMostRecentDailyRecord, bocwStats:StatsWithMostRecentDailyRecord, byMonth:[MonthStats], mostRecentRecord:String) {
|
||||||
self.overall = overall
|
self.overall = overall
|
||||||
self.byMonth = byMonth
|
self.byMonth = byMonth
|
||||||
self.highestWinLossRatio = highestWinLossRatio
|
|
||||||
self.dataPoints = dataPoints
|
|
||||||
self.mostRecentRecord = mostRecentRecord
|
self.mostRecentRecord = mostRecentRecord
|
||||||
self.mwStats = mwStats;
|
self.mwStats = mwStats;
|
||||||
self.bocwStats = bocwStats;
|
self.bocwStats = bocwStats;
|
||||||
|
|||||||
Reference in New Issue
Block a user