diff options
author | 2011-07-03 23:33:33 +0530 | |
---|---|---|
committer | 2011-07-03 23:33:33 +0530 | |
commit | f5f0837b3bb3a7bdbf3adde70a6defcb3819c602 (patch) | |
tree | b4c908631f152dea7d5a04cb245ab2c88bdd3c30 | |
parent | update module name to app in tests (diff) | |
download | gentoostats-f5f0837b3bb3a7bdbf3adde70a6defcb3819c602.tar.gz gentoostats-f5f0837b3bb3a7bdbf3adde70a6defcb3819c602.tar.bz2 gentoostats-f5f0837b3bb3a7bdbf3adde70a6defcb3819c602.zip |
more stats pages
-rwxr-xr-x | server/app.py | 16 | ||||
-rw-r--r-- | server/arch.py | 10 | ||||
-rw-r--r-- | server/feature.py | 10 | ||||
-rw-r--r-- | server/kwd.py | 10 | ||||
-rw-r--r-- | server/lang.py | 10 | ||||
-rw-r--r-- | server/mirror.py | 10 | ||||
-rw-r--r-- | server/profile.py | 10 | ||||
-rw-r--r-- | server/repo.py | 10 | ||||
-rw-r--r-- | server/templates/arch.html | 11 | ||||
-rw-r--r-- | server/templates/feature.html | 11 | ||||
-rw-r--r-- | server/templates/keyword.html | 12 | ||||
-rw-r--r-- | server/templates/lang.html | 11 | ||||
-rw-r--r-- | server/templates/mirror.html | 11 | ||||
-rw-r--r-- | server/templates/profile.html | 11 | ||||
-rw-r--r-- | server/templates/repo.html | 12 | ||||
-rw-r--r-- | server/templates/use.html | 11 | ||||
-rw-r--r-- | server/use.py | 10 |
17 files changed, 186 insertions, 0 deletions
diff --git a/server/app.py b/server/app.py index 89ade62..ba77639 100755 --- a/server/app.py +++ b/server/app.py @@ -4,10 +4,26 @@ import web import config from config import render from index import Index +from arch import Arch +from profile import Profile +from mirror import Mirror +from feature import Feature +from kwd import Keyword +from use import Use +from repo import Repo +from lang import Lang from host import Host urls = ( r'/', 'Index', + r'/arch', 'Arch', + r'/profile', 'Profile', + r'/mirror', 'Mirror', + r'/feature', 'Feature', + r'/keyword', 'Keyword', + r'/use', 'Use', + r'/repo', 'Repo', + r'/lang', 'Lang', r'/host/(.+)', 'Host' ) diff --git a/server/arch.py b/server/arch.py new file mode 100644 index 0000000..a389b8f --- /dev/null +++ b/server/arch.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Arch(object): + def GET(self): + arch_count = db.select('ENV', what='ARCH, COUNT(UUID) AS HOSTS', group='ARCH') + arch_data = dict() + for t in arch_count: + arch_data[t['ARCH']] = {'HOSTS':t['HOSTS']} + return render.arch(arch_data) diff --git a/server/feature.py b/server/feature.py new file mode 100644 index 0000000..4b79da5 --- /dev/null +++ b/server/feature.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Feature(object): + def GET(self): + feature_count = db.query('SELECT FEATURE,COUNT(UUID) AS HOSTS FROM HOST_FEATURES NATURAL JOIN FEATURES GROUP BY FEATURE') + feature_data = dict() + for t in feature_count: + feature_data[t['FEATURE']] = {'HOSTS':t['HOSTS']} + return render.feature(feature_data) diff --git a/server/kwd.py b/server/kwd.py new file mode 100644 index 0000000..88fc799 --- /dev/null +++ b/server/kwd.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Keyword(object): + def GET(self): + keyword_count = db.query('SELECT KEYWORD, COUNT(DISTINCT IPKEY) AS PACKAGES, COUNT(DISTINCT UUID) AS HOSTS FROM GLOBAL_KEYWORDS NATURAL JOIN KEYWORDS NATURAL JOIN INSTALLED_PACKAGES GROUP BY KEYWORD') + keyword_data = dict() + for t in keyword_count: + keyword_data[t['KEYWORD']] = {'HOSTS':t['HOSTS'],'PACKAGES':t['PACKAGES']} + return render.keyword(keyword_data) diff --git a/server/lang.py b/server/lang.py new file mode 100644 index 0000000..3f4ebfb --- /dev/null +++ b/server/lang.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Lang(object): + def GET(self): + lang_count = db.query('SELECT LANG,COUNT(UUID) AS HOSTS FROM HOST_LANG NATURAL JOIN LANG GROUP BY LANG') + lang_data = dict() + for t in lang_count: + lang_data[t['LANG']] = {'HOSTS':t['HOSTS']} + return render.lang(lang_data) diff --git a/server/mirror.py b/server/mirror.py new file mode 100644 index 0000000..7084831 --- /dev/null +++ b/server/mirror.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Mirror(object): + def GET(self): + mirror_count = db.query('SELECT MIRROR,COUNT(UUID) AS HOSTS FROM HOST_MIRRORS NATURAL JOIN GENTOO_MIRRORS GROUP BY MIRROR') + mirror_data = dict() + for t in mirror_count: + mirror_data[t['MIRROR']] = {'HOSTS':t['HOSTS']} + return render.mirror(mirror_data) diff --git a/server/profile.py b/server/profile.py new file mode 100644 index 0000000..211963c --- /dev/null +++ b/server/profile.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Profile(object): + def GET(self): + profile_count = db.select('ENV', what='PROFILE, COUNT(UUID) AS HOSTS', group='PROFILE') + profile_data = dict() + for t in profile_count: + profile_data[t['PROFILE']] = {'HOSTS':t['HOSTS']} + return render.profile(profile_data) diff --git a/server/repo.py b/server/repo.py new file mode 100644 index 0000000..4348248 --- /dev/null +++ b/server/repo.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Repo(object): + def GET(self): + repo_count = db.query('select REPO,COUNT(DISTINCT IPKEY) AS PACKAGES,COUNT(DISTINCT UUID) AS HOSTS from INSTALLED_PACKAGES natural join REPOSITORIES group by REPO') + repo_data = dict() + for t in repo_count: + repo_data[t['REPO']] = {'HOSTS':t['HOSTS'], 'PACKAGES':t['PACKAGES']} + return render.repo(repo_data) diff --git a/server/templates/arch.html b/server/templates/arch.html new file mode 100644 index 0000000..535399c --- /dev/null +++ b/server/templates/arch.html @@ -0,0 +1,11 @@ +$def with (arch_data) +$var title: Arch + +<table border="1"> + <tr> + <th>Arch</th> + <th>Hosts</th> + </tr> + $for arch in arch_data.keys(): + <tr><td>$arch</td><td>$arch_data[arch]['HOSTS']</td></tr> +</table> diff --git a/server/templates/feature.html b/server/templates/feature.html new file mode 100644 index 0000000..03c4bbd --- /dev/null +++ b/server/templates/feature.html @@ -0,0 +1,11 @@ +$def with (feature_data) +$var title: Feature + +<table border="1"> + <tr> + <th>Feature</th> + <th>Hosts</th> + </tr> + $for feature in feature_data.keys(): + <tr><td>$feature</td><td>$feature_data[feature]['HOSTS']</td></tr> +</table> diff --git a/server/templates/keyword.html b/server/templates/keyword.html new file mode 100644 index 0000000..4855040 --- /dev/null +++ b/server/templates/keyword.html @@ -0,0 +1,12 @@ +$def with (keyword_data) +$var title: Keyword + +<table border="1"> + <tr> + <th>Keyword</th> + <th>Hosts</th> + <th>Packages</th> + </tr> + $for keyword in keyword_data.keys(): + <tr><td>$keyword</td><td>$keyword_data[keyword]['HOSTS']</td><td>$keyword_data[keyword]['PACKAGES']</td></tr> +</table> diff --git a/server/templates/lang.html b/server/templates/lang.html new file mode 100644 index 0000000..cfda84a --- /dev/null +++ b/server/templates/lang.html @@ -0,0 +1,11 @@ +$def with (lang_data) +$var title: Lang + +<table border="1"> + <tr> + <th>Lang</th> + <th>Hosts</th> + </tr> + $for lang in lang_data.keys(): + <tr><td>$lang</td><td>$lang_data[lang]['HOSTS']</td></tr> +</table> diff --git a/server/templates/mirror.html b/server/templates/mirror.html new file mode 100644 index 0000000..a6189bc --- /dev/null +++ b/server/templates/mirror.html @@ -0,0 +1,11 @@ +$def with (mirror_data) +$var title: Mirror + +<table border="1"> + <tr> + <th>Mirror</th> + <th>Hosts</th> + </tr> + $for mirror in mirror_data.keys(): + <tr><td>$mirror</td><td>$mirror_data[mirror]['HOSTS']</td></tr> +</table> diff --git a/server/templates/profile.html b/server/templates/profile.html new file mode 100644 index 0000000..702b03b --- /dev/null +++ b/server/templates/profile.html @@ -0,0 +1,11 @@ +$def with (profile_data) +$var title: Profile + +<table border="1"> + <tr> + <th>Profile/th> + <th>Hosts</th> + </tr> + $for profile in profile_data.keys(): + <tr><td>$profile</td><td>$profile_data[profile]['HOSTS']</td></tr> +</table> diff --git a/server/templates/repo.html b/server/templates/repo.html new file mode 100644 index 0000000..63371bb --- /dev/null +++ b/server/templates/repo.html @@ -0,0 +1,12 @@ +$def with (repo_data) +$var title: Repository + +<table border="1"> + <tr> + <th>Repository</th> + <th>Hosts</th> + <th>Packages</th> + </tr> + $for repo in repo_data.keys(): + <tr><td>$repo</td><td>$repo_data[repo]['HOSTS']</td><td>$repo_data[repo]['PACKAGES']</td></tr> +</table> diff --git a/server/templates/use.html b/server/templates/use.html new file mode 100644 index 0000000..209f8f8 --- /dev/null +++ b/server/templates/use.html @@ -0,0 +1,11 @@ +$def with (use_data) +$var title: Use + +<table border="1"> + <tr> + <th>Use</th> + <th>Hosts</th> + </tr> + $for use in use_data.keys(): + <tr><td>$use</td><td>$use_data[use]['HOSTS']</td></tr> +</table> diff --git a/server/use.py b/server/use.py new file mode 100644 index 0000000..dfdcfaf --- /dev/null +++ b/server/use.py @@ -0,0 +1,10 @@ + +from config import render, db + +class Use(object): + def GET(self): + use_count = db.query('SELECT USEFLAG,COUNT(UUID) AS HOSTS FROM GLOBAL_USEFLAGS NATURAL JOIN USEFLAGS GROUP BY USEFLAG') + use_data = dict() + for t in use_count: + use_data[t['USEFLAG']] = {'HOSTS':t['HOSTS']} + return render.use(use_data) |