Skip to content

Comments statistics

Yuriy Gerasimov edited this page May 27, 2014 · 1 revision

Data structure

User's Comments

We store following information about user's comments. We keep information for last month only. Everything older will be automatically removed.

Data structure:

  • cid
  • timestamp
  • nid
  • project
  • body
  • type

Issue-comments counters

We keep counters of all issues user participated for last month to track what issues should be rescanned regarding new comments. This is taken from d.o/user/X/track

  • nid
  • counter

Comments properties field

comment stats by types:

  • just comment
  • comment with code (we think this is a review)
  • comment with patch

Algorythm

Every week we add each user to a queue to scan for new comments. QueueScanUserComments

By cron runs we scan user track page (taking from QueueScanUserComments queue), check what issues for last month has changed their comments counters and put these issues to another queue for scanning issue. QueueScanIssueComments

By cron runs we scan issues from QueueScanIssueComments and scan issue pages themselves.

When we scan issue page we go from the bottom to top and check new comments by this particular user until we found comment stored in our db or comment should not be checked by its creation date.

Clone this wiki locally