Difference between revisions of "Stats Design"

From Dreamwidth Notes
Jump to: navigation, search
(Add link to project team)
(Wikifi format, expand statistics collection section)
Line 5: Line 5:
 
[[Project_Teams#Site_statistics|Stats project team]] (we're recruiting)
 
[[Project_Teams#Site_statistics|Stats project team]] (we're recruiting)
  
Table definitions:
+
== =Table definitions ==
  
 
<source lang="sql">CREATE TABLE statkeylist (
 
<source lang="sql">CREATE TABLE statkeylist (
Line 27: Line 27:
 
)</source>
 
)</source>
  
Storing statistics: [http://hg.dwscoalition.org/dw-free/file/67e1042df080/cgi-bin/DW/StatStore.pm DW::StatStore]
+
== Storing statistics ==
  
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::*]
+
[http://hg.dwscoalition.org/dw-free/file/tip/cgi-bin/DW/StatStore.pm DW::StatStore]
  
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]
+
== Statistics items ==
  
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)
+
* [http://hg.dwscoalition.org/dw-free/file/tip/cgi-bin/DW/StatData.pm DW::StatData]
 +
* [http://hg.dwscoalition.org/dw-free/file/tip/cgi-bin/DW/StatData/ DW::StatData::*]
 +
 
 +
== Collecting statistics ==
 +
 
 +
# [http://hg.dwscoalition.org/dw-free/file/tip/etc/stats-collection.conf etc/stats-collection.conf] should contain something like:<source>## collect and store all stats under the accounts category
 +
## hangs if you don't enclose the asterisk in quotes
 +
# accounts: "*"
 +
## collect and store only these stats under the accounts category
 +
# accounts: [ identity, personal, redirect ]
 +
accounts: "*"
 +
active: "*"
 +
paid: "*"</source>
 +
# [http://hg.dwscoalition.org/dw-free/file/tip/bin/worker/stats-collection bin/worker/stats-collection] is the utility that handles stats collection. Run at least once per 24 hours, either from your crontab or by listing it in [http://hg.dwscoalition.org/dw-free/file/tip/etc/workers.conf etc/workers.conf].
 +
# (only needed if you chose to use [http://hg.dwscoalition.org/dw-free/file/tip/etc/workers.conf etc/workers.conf]): add a line to the "all" section reading:<source>  stats-collection: 1</source>(note: this is for development only, as it assumes you only have one server - in production environments, you will usually list it in the section for a specific server)
 +
 
 +
== Displaying statistics ==
 +
 
 +
* [http://hg.dwscoalition.org/dw-free/file/tip/htdocs/stats/ htdocs/stats/*] (public stats)
 +
* [http://hg.dwscoalition.org/dw-free/file/tip/htdocs/admin/stats.bml htdocs/admin/stats.bml] (restricted stats)
 +
 
 +
(note: as of March 28 there is an [http://bugs.dwscoalition.org/attachment.cgi?id=3299 uncommitted patch] on bug 124 [[Routing_and_Template_Toolkit|TTizing] the stats display to DW::Controller::SiteStats, views/admin/stats.tt, view/site/stats.tt)

Revision as of 15:58, 30 March 2010

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

Stats project team (we're recruiting)

=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 items

Collecting statistics

  1. etc/stats-collection.conf should contain something like:

    Invalid language.

    You need to specify a language like this: <source lang="html4strict">...</source>

    Supported languages for syntax highlighting:

    4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, s2, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


    ## collect and store all stats under the accounts category
    
    1. hangs if you don't enclose the asterisk in quotes
  2. accounts: "*"
    1. collect and store only these stats under the accounts category
  3. accounts: [ identity, personal, redirect ]

accounts: "*" active: "*"

paid: "*"
  1. bin/worker/stats-collection is the utility that handles stats collection. Run at least once per 24 hours, either from your crontab or by listing it in etc/workers.conf.
  2. (only needed if you chose to use etc/workers.conf): add a line to the "all" section reading:

    Invalid language.

    You need to specify a language like this: <source lang="html4strict">...</source>

    Supported languages for syntax highlighting:

    4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, s2, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


      stats-collection: 1
    (note: this is for development only, as it assumes you only have one server - in production environments, you will usually list it in the section for a specific server)

Displaying statistics

(note: as of March 28 there is an uncommitted patch on bug 124 [[Routing_and_Template_Toolkit|TTizing] the stats display to DW::Controller::SiteStats, views/admin/stats.tt, view/site/stats.tt)