Skip to content

Commit

Permalink
Summarize: Need to transform timeout count to rate
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Dec 25, 2024
1 parent c5d9b9f commit 2dbe6a2
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions utils/summarize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,16 +530,6 @@ export const handler: Handler = async (event: any, context?: any) => {
}
}

// timeouts
for (const t of siteTimeouts) {
const daysAgo = (baseline - t) / (24 * 60 * 60 * 1000);
const bucket = Math.floor(daysAgo / 7);
histTimeoutBuckets.push(bucket);
}
for (let i = 0; i <= Math.max(...histTimeoutBuckets); i++) {
histTimeouts.push(histTimeoutBuckets.filter(x => x === i).length);
}

// all games
const histAll: number[] = [];
const histAllPlayers: number[] = [];
Expand All @@ -552,6 +542,21 @@ export const handler: Handler = async (event: any, context?: any) => {
}
histAllPlayers.push(users.size);
}

// timeouts
for (const t of siteTimeouts) {
const daysAgo = (baseline - t) / (24 * 60 * 60 * 1000);
const bucket = Math.floor(daysAgo / 7);
histTimeoutBuckets.push(bucket);
}
for (let i = 0; i <= Math.max(...histTimeoutBuckets); i++) {
histTimeouts.push(histTimeoutBuckets.filter(x => x === i).length);
}
// convert to rate
for (let i = 0; i < histTimeouts.length; i++) {
histTimeouts[i] = histTimeouts[i] / histAll[i];
}

const histMeta: GameNumList[] = [];
const recent: GameNumber[] = [];
for (const meta of meta2recs.keys()) {
Expand Down

0 comments on commit 2dbe6a2

Please sign in to comment.