Rank trending by counting plays, and the longest movie always wins
transcript
Rank Trending Now by counting events in the last hour. The longest movie wins. Not because more people watch it. Because it sends more heartbeats.
Each viewer sends an event about every 10 seconds, mostly heartbeats. Longer titles pile them up. New releases always dominate. And one bot can send thousands of events.
So count people instead. Unique viewers per title, approximated with HyperLogLog. Under 10 viewers? Skipped. Then velocity. This hour's viewers, against the title's own 24 hour hourly average. Is it spiking? Divide by its category's baseline. Unusually popular, for its kind? Rising? Multiply by 1 plus half the velocity. Then sort, and rank.
But here's the catch. A plain 1 hour window only emits once an hour. So the hour slides every minute instead. A fresh answer each minute. That fits the target: trending within 60 seconds. Social media is the competition.
One bot's flood counts as one viewer. A long movie can't win on heartbeats. Count people, not events. Trending isn't big. It's unusually big.
Full breakdown in the lecture.