Remove data point calucations for now

This commit is contained in:
Michael Simard
2020-12-22 11:33:27 -06:00
parent d58d91110b
commit 0e4c0ef7c1
2 changed files with 9 additions and 13 deletions

View File

@@ -263,20 +263,20 @@ struct StatsController: RouteCollection {
// print ( Date().timeIntervalSince(startTime))
let cumulativeWinLossRatios = self.getCumulativeWinLossRatios(matches: matches)
// let cumulativeWinLossRatios = self.getCumulativeWinLossRatios(matches: matches)
// print ( Date().timeIntervalSince(startTime))
let highestWinLossRatio = cumulativeWinLossRatios.reduce("0") { (highestRatio, dataPoint) -> String in
if dataPoint.y > Double(highestRatio)!{
return String(dataPoint.y)
}
return highestRatio
}
// let highestWinLossRatio = cumulativeWinLossRatios.reduce("0") { (highestRatio, dataPoint) -> String in
// if dataPoint.y > Double(highestRatio)!{
// return String(dataPoint.y)
// }
// return highestRatio
// }
// 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)")
}