Difference between revisions of "Stats Design"

From Dreamwidth Notes
Jump to: navigation, search
(Another link)
(More links, some reformatting)
Line 1: Line 1:
This is a placeholder for the Stats design page.
+
This is a a loosely organized collection of notes and links for the Stats feature design. (Note: this is for the new stats system only - there's an existing legacy system too.)
  
http://bugs.dwscoalition.org/show_bug.cgi?id=124
+
[http://bugs.dwscoalition.org/show_bug.cgi?id=124 Bug 124]
  
Table definition:
+
Table definitions:
  
CREATE TABLE statkeylist (  
+
<source lang="sql">CREATE TABLE statkeylist (
 
     statkeyid int unsigned NOT NULL auto_increment,  
 
     statkeyid int unsigned NOT NULL auto_increment,  
 
     name varchar(255) default NULL,  
 
     name varchar(255) default NULL,  
Line 11: Line 11:
 
     PRIMARY KEY (statkeyid),  
 
     PRIMARY KEY (statkeyid),  
 
     UNIQUE KEY (name)  
 
     UNIQUE KEY (name)  
)  
+
)
  
 
CREATE TABLE site_stats (  
 
CREATE TABLE site_stats (  
Line 23: Line 23:
 
     -- time (ie, last 5 entries, or last 2 weeks). Do we need an extra index?  
 
     -- time (ie, last 5 entries, or last 2 weeks). Do we need an extra index?  
 
     INDEX (category_id, key_id, insert_time)  
 
     INDEX (category_id, key_id, insert_time)  
)  
+
)</source>
  
Storing statistics: http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatStore.pm
+
Storing statistics: [http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatStore.pm DW::StatStore]
  
Statistics: http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatData.pm and http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatData/
+
Statistics: [http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatData.pm DW::StatData] and [http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatData/ DW::StatData::*]
  
Collecting statistics: http://hg.dwscoalition.org/dw-free/file/67e1042df080/bin/worker/stats-collection and http://hg.dwscoalition.org/dw-free/file/c2251ce4caf8/etc/stats-collection.conf
+
Collecting statistics: [http://hg.dwscoalition.org/dw-free/file/67e1042df080/bin/worker/stats-collection bin/worker/stats-collection] and [http://hg.dwscoalition.org/dw-free/file/c2251ce4caf8/etc/stats-collection.conf etc/stats-collection.conf]
  
Displaying statistics:
+
Displaying statistics: [http://hg.dwscoalition.org/dw-free/file/67e1042df080/htdocs/stats/ htdocs/stats/*] (public stats) and [http://hg.dwscoalition.org/dw-free/file/67e1042df080/htdocs/admin/stats.bml htdocs/admin/stats.bml] (restricted stats)

Revision as of 19:35, 16 August 2009

This is a a loosely organized collection of notes and links for the Stats feature design. (Note: this is for the new stats system only - there's an existing legacy system too.)

Bug 124

Table definitions:

CREATE TABLE statkeylist (
    statkeyid INT UNSIGNED NOT NULL AUTO_INCREMENT, 
    name VARCHAR(255) DEFAULT NULL, 
 
    PRIMARY KEY (statkeyid), 
    UNIQUE KEY (name) 
)
 
CREATE TABLE site_stats ( 
    category_id INT UNSIGNED NOT NULL, 
    key_id INT UNSIGNED NOT NULL, 
    insert_time INT UNSIGNED NOT NULL, 
    VALUE INT UNSIGNED NOT NULL, 
 
    -- FIXME: This is good for retrieving data for a single category+key, but 
    -- maybe not as good if we want all keys for the category, with a limit on 
    -- time (ie, last 5 entries, or last 2 weeks). Do we need an extra index? 
    INDEX (category_id, key_id, insert_time) 
)

Storing statistics: DW::StatStore

Statistics: DW::StatData and DW::StatData::*

Collecting statistics: bin/worker/stats-collection and etc/stats-collection.conf

Displaying statistics: htdocs/stats/* (public stats) and htdocs/admin/stats.bml (restricted stats)