[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] Plugin for page view counter

From: Tiberiu C. Turbureanu
Subject: [GMG-Devel] Plugin for page view counter
Date: Sun, 06 Jan 2013 15:13:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0


I am new to both Python and MediaGoblin, but I've just setup an instance on my organization server and I'm thrilled of what it can do already! I also supported the project through a donation last year during the campaign, because I believe in the importance of this Free Software project to fill a gap in the online video distribution.

I would like to start contributing by writing a plugin that counts the number of views, something basic, not the full stats functionality Youtube has. But it would be really nice at least for my organization to have this simple success metric available.

I read the and related to plugin development and I believe I can write this plugin. But I would need a little bit of mentoring. I am also available on the IRC channel #mediagoblin (nick: tct).

I am thinking that this plugin could add a new table to the gmg database and be 1-1 with the core__mediafiles. I don't like the idea to alter the core table for reasons related to upstream development and stability.

This new table would have two columns: the id of the media file and the counter, by default set to zero. Then all the plugin would have to do everytime a media file page is loaded is to read the counter from the table, increment it and store it back in the table.

I know that there can be data races when a media file is played by multiple users. I am happy to hear from you if Python has some atomic increment for its storage abstraction.

Or if you see another approach for the data race problem, like keeping view counters for concurrent accesses in memory and writing it back to the data base when the media file is not played anymore. But this would not scale for many concurrent users on a service with a large collection of media files.

Or maybe you have other ideas. Anyway, I will appreciate any help. Thank you in advance!

Tiberiu C. Turbureanu
Președinte, Fundația Ceata
Calea Călărași nr. 57, ap. 2, București
Secretariat: +40-761-810-100
Susții libertatea artelor și tehnologiilor?
Înscrie-te ca membru! (

reply via email to

[Prev in Thread] Current Thread [Next in Thread]