Feb 16, 2011

4:11 PM

Explaining the Story View Counts

Written by Dave Beckett • Filed under Technology

This week we announced that we added a little icon to the story permalink pages that shows a view count and we have had feedback that people wanted to know more about what the number is.

story view counts

Why are we showing this number at all? The idea is to give users a view into the activity that the story is receiving on Digg, in addition to the Digg count.

There are two counters that are used to form this number:

  1. Number of views of the story's permalink page on Digg
  2. Number of exit clicks to the story from Digg

Right now we add those together rather than show three numbers on a story permalink (Digg count, views and exit clicks) just because we thought it might make the display cluttered.

How it works

This counting is done in real time. We watch the server logs for fetches of the permalink pages urls with those like /news/topic/title and the exit click urls are redirects like through the /story/r/title. When we see a fetch, we update counters in Redis which writes to memory very quickly so the numbers change pretty much immediately. On the web page side we read the counters live from Redis and merge the data into the item data that is fetched from Cassandra or (more likely) Memcached. Redis rocks!

If you have any more comments or questions please let us know or give us a shout over on Twitter with your feedback.

343