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)")
}

View File

@@ -29,15 +29,11 @@ final class AllStats: Content {
var mwStats:StatsWithMostRecentDailyRecord
var bocwStats:StatsWithMostRecentDailyRecord
var byMonth: [MonthStats]
var highestWinLossRatio:String
var dataPoints:[DataPoint]
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.byMonth = byMonth
self.highestWinLossRatio = highestWinLossRatio
self.dataPoints = dataPoints
self.mostRecentRecord = mostRecentRecord
self.mwStats = mwStats;
self.bocwStats = bocwStats;