diff --git a/mozilla/tools/download-stats/defs/bugzilla-2.16.5-2.17.7.pl b/mozilla/tools/download-stats/defs/bugzilla-2.16.5-2.17.7.pl new file mode 100755 index 00000000000..9aaf28674aa --- /dev/null +++ b/mozilla/tools/download-stats/defs/bugzilla-2.16.5-2.17.7.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +@stats = ( + { + name => 'Bugzilla', + version => '20040303', + isactive => 1, + path => '/pub/mozilla.org/webtools', + platforms => { + '2.16.4' => { + standard => { name => "bugzilla-2.16.4.tar.gz" } + }, + '2.17.6' => { + standard => { name => "bugzilla-2.17.6.tar.gz" } + }, + 'bugzilla-submit' => { + standard => { name => "bugzilla-submit-0.5.tar.gz" } + }, + } + } +); + +1; diff --git a/mozilla/tools/download-stats/defs/mozilla1.6-firebird0.8.pl b/mozilla/tools/download-stats/defs/mozilla1.6-firebird0.8.pl new file mode 100755 index 00000000000..47ad967a622 --- /dev/null +++ b/mozilla/tools/download-stats/defs/mozilla1.6-firebird0.8.pl @@ -0,0 +1,85 @@ +#!/usr/bin/perl + +@stats = ( + { + name => 'Mozilla', + version => '1.5', + isactive => 0, + path => '/pub/mozilla.org/mozilla/releases/mozilla1.5', + platforms => { + Windows => { + stub => { name => "mozilla-win32-1.5-stub-installer.exe", size => 231120 }, + installer => { name => "mozilla-win32-1.5-installer.exe", size => 12432080 }, + zip => { name => "mozilla-win32-1.5.zip", size => 10805398 }, + tbzip => { name => "mozilla-win32-1.5-talkback.zip", size => 11063159 } + }, + Mac => { + standard => { name => "mozilla-mac-MachO-1.5.dmg.gz" } + }, + Linux => { + stub => { name => "mozilla-i686-pc-linux-gnu-1.5-installer.tar.gz" }, + installer => { name => "mozilla-i686-pc-linux-gnu-1.5-sea.tar.gz" }, + tarball => { name => "mozilla-i686-pc-linux-gnu-1.5.tar.gz" } + } + } + }, + { + name => 'Mozilla', + version => '1.6', + isactive => 1, + path => '/pub/mozilla.org/mozilla/releases/mozilla1.6', + platforms => { + Windows => { + stub => { name => "mozilla-win32-1.6-stub-installer.exe" }, + installer => { name => "mozilla-win32-1.6-installer.exe" }, + zip => { name => "mozilla-win32-1.6.zip" }, + }, + Mac => { + standard => { name => "mozilla-mac-MachO-1.6.dmg.gz" } + }, + Linux => { + stub => { name => "mozilla-i686-pc-linux-gnu-1.6-stub-installer.tar.gz" }, + installer => { name => "mozilla-i686-pc-linux-gnu-1.6-installer.tar.gz" }, + tarball => { name => "mozilla-i686-pc-linux-gnu-1.6.tar.gz" } + } + } + }, + { + name => 'Firefox', + version => '0.8', + isactive => 1, + path => '/pub/mozilla.org/firefox/releases/0.8', + platforms => { + Windows => { + zip => { name => "Firefox-0.8.zip" }, + installer => { name => "FirefoxSetup-0.8.exe" } + }, + Mac => { + standard => { name => "firefox-0.8-mac.dmg.gz" } + }, + Linux => { + tarball => { name => "firefox-0.8-i686-pc-linux-gnu.tar.gz" }, + gtk2xft => { name => "firefox-0.8-i686-linux-gtk2+xft.tar.gz" } + } + } + }, + { + name => 'Thunderbird', + version => '0.3', + isactive => 0, + path => '/pub/mozilla.org/thunderbird/releases/0.3', + platforms => { + Windows => { + standard => { name => "thunderbird-0.3-win32.zip" } + }, + Mac => { + standard => { name => "thunderbird-0.3-macosx.dmg.gz" } + }, + Linux => { + standard => { name => "thunderbird-0.3-i686-pc-linux-gtk2-gnu.tar.bz2" } + } + } + } +); + +1; diff --git a/mozilla/tools/download-stats/sample-stats-config.pl b/mozilla/tools/download-stats/defs/sample.pl old mode 100644 new mode 100755 similarity index 100% rename from mozilla/tools/download-stats/sample-stats-config.pl rename to mozilla/tools/download-stats/defs/sample.pl diff --git a/mozilla/tools/download-stats/defs/thunderbird-stats.pl b/mozilla/tools/download-stats/defs/thunderbird-stats.pl new file mode 100755 index 00000000000..33749da23c7 --- /dev/null +++ b/mozilla/tools/download-stats/defs/thunderbird-stats.pl @@ -0,0 +1,56 @@ +@stats = ( + { + name => 'Thunderbird', + version => '0.4', + isactive => 1, + path => '/pub/mozilla.org/thunderbird/releases/0.4', + platforms => { + Windows => { + standard => { name => "thunderbird-0.4-win32.zip" } + }, + Mac => { + standard => { name => "thunderbird-0.4-macosx.dmg.gz" } + }, + Linux => { + standard => { name => "thunderbird-0.4-i686-pc-linux-gtk2-gnu.tar.bz2" } + } + } + }, + { + name => 'Thunderbird', + version => '0.5', + isactive => 1, + path => '/pub/mozilla.org/thunderbird/releases/0.5', + platforms => { + Windows => { + standard => { name => "thunderbird-0.5-win32.zip" } + }, + Mac => { + standard => { name => "thunderbird-0.5-macosx.dmg.gz" } + }, + Linux => { + standard => { name => "thunderbird-0.5-i686-pc-linux-gtk2-gnu.tar.bz2" } + } + } + }, + { + name => 'Thunderbird', + version => '0.6', + isactive => 1, + path => '/pub/mozilla.org/thunderbird/releases/0.6', + platforms => { + Windows => { + standard => { name => "thunderbird-0.6-win32.zip" }, + installer => { name => "ThunderbirdSetup-0.6.exe" } + }, + Mac => { + standard => { name => "thunderbird-0.6-macosx.dmg.gz" } + }, + Linux => { + standard => { name => "thunderbird-0.6-i686-linux-gtk2+xft.tar.gz" } + } + } + } +); + +1; diff --git a/mozilla/tools/download-stats/lookup-hosts.pl b/mozilla/tools/download-stats/lookup-hosts.pl new file mode 100755 index 00000000000..90e5126e96e --- /dev/null +++ b/mozilla/tools/download-stats/lookup-hosts.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl + +use DBI; +use Socket; +use strict; + +$| = 1; + +my $verbose = 1; + +# Establish a database connection. +my $dsn = "DBI:mysql:host=mecha.mozilla.org;database=logs;port=3306"; +my $dbh = DBI->connect($dsn, + "logs", + "1ssw?w?", + { RaiseError => 1, + PrintError => 0, + ShowErrorStatement => 1 } + ); + +my $sth = $dbh->prepare("UPDATE entries SET client = ? WHERE client = ?"); + +my $ips = $dbh->selectcol_arrayref('SELECT DISTINCT(client) FROM entries + WHERE client REGEXP "^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}$"'); + +my $count = scalar(@$ips); + +print STDERR "$count total addresses to look up.\n" if $verbose; + +my $attempted = 0; +my $succeeded = 0; + +my ($ip, $host); +foreach $ip (@$ips) { + $host = gethostbyaddr(inet_aton($ip), AF_INET); + + if ($host) { + $sth->execute($host, $ip); + ++$succeeded; + #print STDERR "$ip = $host\n" if $verbose; + } + else { + #print STDERR "No match for $ip\n" if $verbose; + } + + ++$attempted; + print STDERR "$succeeded/$attempted/$count\n" if ($attempted % 100) == 0 && $verbose; +} diff --git a/mozilla/tools/download-stats/schema.sql b/mozilla/tools/download-stats/schema.sql new file mode 100644 index 00000000000..5c67fa96290 --- /dev/null +++ b/mozilla/tools/download-stats/schema.sql @@ -0,0 +1,69 @@ +-- MySQL dump 9.08 +-- +-- Host: localhost Database: logs +--------------------------------------------------------- +-- Server version 4.0.14-standard-log + +-- +-- Current Database: logs +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ logs; + +USE logs; + +-- +-- Table structure for table 'entries' +-- + +CREATE TABLE entries ( + id int(11) NOT NULL default '0', + protocol varchar(4) default NULL, + protocol_version varchar(5) default NULL, + client varchar(50) default NULL, + date_time datetime default NULL, + method varchar(4) default NULL, + file_id int(11) default NULL, + status char(3) default NULL, + bytes int(11) default NULL, + site_id tinyint(4) default NULL, + log_id int(11) default NULL, + PRIMARY KEY (id) +) TYPE=MyISAM; + +-- +-- Table structure for table 'files' +-- + +CREATE TABLE files ( + id int(11) NOT NULL default '0', + path varchar(150) default NULL, + name varchar(100) default NULL, + PRIMARY KEY (id), + UNIQUE KEY path (path,name) +) TYPE=MyISAM; + +-- +-- Table structure for table 'logs' +-- + +CREATE TABLE logs ( + id int(11) NOT NULL default '0', + path varchar(100) default NULL, + name varchar(50) default NULL, + site_id tinyint(4) default NULL, + status varchar(10) default NULL, + PRIMARY KEY (id) +) TYPE=MyISAM; + +-- +-- Table structure for table 'sites' +-- + +CREATE TABLE sites ( + id int(11) NOT NULL default '0', + abbr varchar(15) default NULL, + PRIMARY KEY (id), + UNIQUE KEY abbr (abbr) +) TYPE=MyISAM; +