From ca9ff83107f88b7b6201c8e0e11e786c5b8b37c0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 19 Oct 2021 21:58:59 +0100 Subject: [PATCH] Debug --- fitnessFunctions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fitnessFunctions.py b/fitnessFunctions.py index b84ed268c..47fb51148 100644 --- a/fitnessFunctions.py +++ b/fitnessFunctions.py @@ -47,6 +47,7 @@ def fitnessPerformance(startTime, fitnessState: {}, def sortedWatchPoints(fitness: {}, fitnessId: str) -> []: """Returns a sorted list of watchpoints + times are in mS """ if not fitness.get('performance'): return [] @@ -56,7 +57,7 @@ def sortedWatchPoints(fitness: {}, fitnessId: str) -> []: for watchPoint, item in fitness['performance'][fitnessId].items(): if not item.get('total'): continue - averageTime = item['total'] / item['ctr'] + averageTime = item['total'] * 1000 / item['ctr'] result.append(str(averageTime) + ' ' + watchPoint) result.sort(reverse=True) return result @@ -86,7 +87,7 @@ def htmlWatchPointsGraph(baseDir: str, fitness: {}, fitnessId: str, '\n' # get the maximum time - maxAverageTime = float(0.00001) + maxAverageTime = float(1) if len(watchPointsList) > 0: maxAverageTime = float(watchPointsList[0].split(' ')[0]) for watchPoint in watchPointsList: @@ -99,7 +100,9 @@ def htmlWatchPointsGraph(baseDir: str, fitness: {}, fitnessId: str, name = watchPoint.split(' ')[1] averageTime = float(watchPoint.split(' ')[0]) heightPercent = int(averageTime * 100 / maxAverageTime) - timeMS = int(averageTime * 1000) + print('heightPercent: ' + str(averageTime) + + ' ' str(heightPercent) + '%') + timeMS = int(averageTime) if timeMS == 0: break htmlStr += \