Re: [Mailman-Developers] [GSoC 2012] Metrics
Hello,
I'm posting some additional details of my outline for this week. For an easier reading please read it in my blog 1.
-- Following a “top-down design” methodology, i came up with additional detail of my design concept.
What information is stored?
As i have already mentioned the information is stored in Django models.
Author This model represents an author of the mailing list. It mostly keeps track of the number of postings and number of threads started. It has the following fields:
mail – CharField (Mail address of the author) totalmails – IntegerField totalthreads – IntegerField firstmsgdate – DateTimeField lastmsgdate – DateTimeField
MailingList This model counts the total number of postings and threads started.
totalmails – IntegerField totalthreads – IntegerField
Month This model associates the author and the mailing list with each month.
author – ForeignKey month – CharField postscount – IntegerField threadscount – IntegerField mailinglist – Boolean (if this is true it corresponds to the whole mailing list)
Year This model is similar to month. It has a year field instead of a month field.
What happens when a new email is posted to the list?
- The IArchiver interface will grab the email and send it to the Metrics class.
- The Metrics class will update the models:
- If the author is sending to the mailing list for the first time, A new Author row will be created to the database. Otherwise, the Posts field will increase by one. - Also, the corresponding row of the two foreign fields (Month and Year) will also increase by one.
- The Posts field of the Mailing List model (as well as the the related rows on the Month and Year models) will increase by one.
What happens when a user requests the Metrics page?
Django will generate a page based on the current models that outputs:
- On top, general metrics about total authors, total mails and total threads, based on the MailingList model and below some charts (AJAX based) that represents this information
- The authors of the mailing list ordered by the number of their total posts, after the general metrics. Each user will correspond to a more specific page with information like date of first and last message on top and a chart on his overall activity below.
What will happen if the app is installed after an existing archive or something crashes on the system? How do the metrics are being recovered?
For this case there should be a special ‘Generate’ button in the admin page. When this button is pressed, the class ‘Generate’ will be triggered and:
- The Django models will be initialized (the metrics will go back to zero). A progress bar will inform the administrator that the operation is being held.
- All the messages of the archive will be parsed by performing a direct Python call to the IArchiver. Another instance to the IArchiver will grab any mails sent while the parsing is going on and store them to a text file.
- The metrics will be generated from scratch.
- The mails stored to the text file will be added to the metrics
- The administrator will be informed with a success message when the process is over.
--
-- George Chatzisofroniou sophron.latthi.com
participants (1)
-
George Chatzisofroniou