mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-20 20:46:15 +08:00
also sending smooth and wpm consistency
This commit is contained in:
parent
1231e6bc9b
commit
08fd9628d2
1 changed files with 14 additions and 1 deletions
|
@ -1450,7 +1450,20 @@ function buildCompletedEvent(difficultyFailed) {
|
|||
}
|
||||
completedEvent.keyConsistency = keyConsistency;
|
||||
completedEvent.consistency = consistency;
|
||||
completedEvent.chartData.raw = Misc.smooth(rawPerSecond, 1);
|
||||
let smoothedraw = Misc.smooth(rawPerSecond, 1);
|
||||
completedEvent.chartData.raw = smoothedraw;
|
||||
|
||||
//smoothed consistency
|
||||
let stddev2 = Misc.stdDev(smoothedraw);
|
||||
let avg2 = Misc.mean(smoothedraw);
|
||||
let smoothConsistency = Misc.roundTo2(Misc.kogasa(stddev2 / avg2));
|
||||
completedEvent.smoothConsistency = smoothConsistency;
|
||||
|
||||
//wpm consistency
|
||||
let stddev3 = Misc.stdDev(completedEvent.chartData.wpm);
|
||||
let avg3 = Misc.mean(completedEvent.chartData.wpm);
|
||||
let wpmConsistency = Misc.roundTo2(Misc.kogasa(stddev3 / avg3));
|
||||
completedEvent.wpmConsistency = wpmConsistency;
|
||||
|
||||
completedEvent.testDuration = parseFloat(stats.time);
|
||||
completedEvent.afkDuration = TestStats.calculateAfkSeconds(
|
||||
|
|
Loading…
Add table
Reference in a new issue