Difference between revisions of "Stats Design"

From Dreamwidth Notes
Jump to: navigation, search
(Dump some stuff in)
(Dump one more link, some reformatting.)
Line 2: Line 2:
  
 
http://bugs.dwscoalition.org/show_bug.cgi?id=124
 
http://bugs.dwscoalition.org/show_bug.cgi?id=124
 +
 
Table definition:
 
Table definition:
 +
 
CREATE TABLE statkeylist (  
 
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,  
 
   
 
   
PRIMARY KEY (statkeyid),  
+
    PRIMARY KEY (statkeyid),  
UNIQUE KEY (name)  
+
    UNIQUE KEY (name)  
 
)  
 
)  
  
 
CREATE TABLE site_stats (  
 
CREATE TABLE site_stats (  
category_id INT UNSIGNED NOT NULL,  
+
    category_id INT UNSIGNED NOT NULL,  
key_id INT UNSIGNED NOT NULL,  
+
    key_id INT UNSIGNED NOT NULL,  
insert_time INT UNSIGNED NOT NULL,  
+
    insert_time INT UNSIGNED NOT NULL,  
value INT UNSIGNED NOT NULL,  
+
    value INT UNSIGNED NOT NULL,  
 
   
 
   
-- FIXME: This is good for retrieving data for a single category+key, but  
+
    -- 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  
+
    -- 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?  
+
    -- 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)  
 
)  
 
)  
  
 
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
 +
 
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 and http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatData/
Collecting statistics:
+
 
 +
Collecting statistics: http://hg.dwscoalition.org/dw-free/file/67e1042df080/bin/worker/stats-collection
 +
 
 
Displaying statistics:
 
Displaying statistics:

Revision as of 19:14, 16 August 2009

This is a placeholder for the Stats design page.

http://bugs.dwscoalition.org/show_bug.cgi?id=124

Table definition:

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: http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatStore.pm

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/

Collecting statistics: http://hg.dwscoalition.org/dw-free/file/67e1042df080/bin/worker/stats-collection

Displaying statistics: