mirror of https://gitlab.com/bashrc2/epicyon
Change fitness metrics structure
parent
2bd1bef5b4
commit
842ee7ec04
|
@ -19,25 +19,26 @@ def fitnessPerformance(startTime, fitnessState: {},
|
||||||
fitnessState['performance'] = {}
|
fitnessState['performance'] = {}
|
||||||
if fitnessId not in fitnessState['performance']:
|
if fitnessId not in fitnessState['performance']:
|
||||||
fitnessState['performance'][fitnessId] = {}
|
fitnessState['performance'][fitnessId] = {}
|
||||||
|
if watchPoint not in fitnessState['performance'][fitnessId]:
|
||||||
|
fitnessState['performance'][fitnessId][watchPoint] = {
|
||||||
|
"total": 0,
|
||||||
|
"ctr": 0
|
||||||
|
}
|
||||||
|
|
||||||
timeDiff = time.time() - startTime
|
timeDiff = time.time() - startTime
|
||||||
|
|
||||||
fitnessState['performance'][fitnessId][watchPoint] = timeDiff
|
fitnessState['performance'][fitnessId][watchPoint]['total'] += timeDiff
|
||||||
if 'total' in fitnessState['performance'][fitnessId]:
|
fitnessState['performance'][fitnessId][watchPoint]['ctr'] += 1
|
||||||
fitnessState['performance'][fitnessId]['total'] += timeDiff
|
if fitnessState['performance'][fitnessId][watchPoint]['ctr'] >= 1024:
|
||||||
fitnessState['performance'][fitnessId]['ctr'] += 1
|
fitnessState['performance'][fitnessId][watchPoint]['total'] /= 2
|
||||||
if fitnessState['performance'][fitnessId]['ctr'] >= 1024:
|
fitnessState['performance'][fitnessId][watchPoint]['ctr'] = \
|
||||||
fitnessState['performance'][fitnessId]['total'] /= 2
|
int(fitnessState['performance'][fitnessId][watchPoint]['ctr'] / 2)
|
||||||
fitnessState['performance'][fitnessId]['ctr'] = \
|
|
||||||
int(fitnessState['performance'][fitnessId]['ctr'] / 2)
|
|
||||||
else:
|
|
||||||
fitnessState['performance'][fitnessId]['total'] = timeDiff
|
|
||||||
fitnessState['performance'][fitnessId]['ctr'] = 1
|
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
|
ctr = fitnessState['performance'][fitnessId][watchPoint]['ctr']
|
||||||
|
total = fitnessState['performance'][fitnessId][watchPoint]['total']
|
||||||
print('FITNESS: performance/' + fitnessId + '/' +
|
print('FITNESS: performance/' + fitnessId + '/' +
|
||||||
watchPoint + '/' +
|
watchPoint + '/' + str(total * 1000 / ctr))
|
||||||
str(fitnessState['performance'][fitnessId][watchPoint]))
|
|
||||||
|
|
||||||
|
|
||||||
def fitnessThread(baseDir: str, fitness: {}):
|
def fitnessThread(baseDir: str, fitness: {}):
|
||||||
|
|
Loading…
Reference in New Issue