File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -530,16 +530,6 @@ export const handler: Handler = async (event: any, context?: any) => {
530530 }
531531 }
532532
533- // timeouts
534- for ( const t of siteTimeouts ) {
535- const daysAgo = ( baseline - t ) / ( 24 * 60 * 60 * 1000 ) ;
536- const bucket = Math . floor ( daysAgo / 7 ) ;
537- histTimeoutBuckets . push ( bucket ) ;
538- }
539- for ( let i = 0 ; i <= Math . max ( ...histTimeoutBuckets ) ; i ++ ) {
540- histTimeouts . push ( histTimeoutBuckets . filter ( x => x === i ) . length ) ;
541- }
542-
543533 // all games
544534 const histAll : number [ ] = [ ] ;
545535 const histAllPlayers : number [ ] = [ ] ;
@@ -552,6 +542,21 @@ export const handler: Handler = async (event: any, context?: any) => {
552542 }
553543 histAllPlayers . push ( users . size ) ;
554544 }
545+
546+ // timeouts
547+ for ( const t of siteTimeouts ) {
548+ const daysAgo = ( baseline - t ) / ( 24 * 60 * 60 * 1000 ) ;
549+ const bucket = Math . floor ( daysAgo / 7 ) ;
550+ histTimeoutBuckets . push ( bucket ) ;
551+ }
552+ for ( let i = 0 ; i <= Math . max ( ...histTimeoutBuckets ) ; i ++ ) {
553+ histTimeouts . push ( histTimeoutBuckets . filter ( x => x === i ) . length ) ;
554+ }
555+ // convert to rate
556+ for ( let i = 0 ; i < histTimeouts . length ; i ++ ) {
557+ histTimeouts [ i ] = histTimeouts [ i ] / histAll [ i ] ;
558+ }
559+
555560 const histMeta : GameNumList [ ] = [ ] ;
556561 const recent : GameNumber [ ] = [ ] ;
557562 for ( const meta of meta2recs . keys ( ) ) {
You can’t perform that action at this time.
0 commit comments