This commit is contained in:
+9
-1
@@ -180,10 +180,18 @@ export async function getPostsData(
|
||||
? 0
|
||||
: Math.ceil(allPosts.length / postLimit)
|
||||
|
||||
const relAge = (ms: number) => {
|
||||
const diffMs = now - ms
|
||||
const d = Math.floor(diffMs / 86_400_000)
|
||||
const h = Math.floor((diffMs % 86_400_000) / 3_600_000)
|
||||
const m = Math.floor((diffMs % 3_600_000) / 60_000)
|
||||
return `${d}d ${h}h ${m}m ago`
|
||||
}
|
||||
|
||||
const method = oldestMs < cutoff ? 'direct' : hitPageCap ? 'extrapolated' : 'raw'
|
||||
console.log(
|
||||
`[mastodon] #${tag} — pages: ${pagesFetched}, posts: ${allPosts.length}, ` +
|
||||
`oldest: ${new Date(oldestMs).toISOString()}, newest: ${new Date(newestMs).toISOString()}, ` +
|
||||
`between: ${relAge(oldestMs)} - ${relAge(newestMs)}, ` +
|
||||
`pph: ${postsPerHour.toFixed(2)} (${method})`,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user