From: Michael Tremer Date: Wed, 25 Oct 2017 17:10:29 +0000 (+0100) Subject: Drop useless statistics page X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11edaf9502f44c533c686e7d228e09435154d843;p=pbs.git Drop useless statistics page Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 21797e15..22f745f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -328,11 +328,6 @@ dist_templates_sessions_DATA = \ templates_sessionsdir = $(templatesdir)/sessions -dist_templates_statistics_DATA = \ - src/templates/statistics/index.html - -templates_statisticsdir = $(templatesdir)/statistics - # ------------------------------------------------------------------------------ # dist_static_DATA = \ diff --git a/po/POTFILES.in b/po/POTFILES.in index 8745dcd2..e9682c8b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -142,7 +142,6 @@ src/templates/search-form.html src/templates/search-results.html src/templates/sessions/index.html src/templates/source-list.html -src/templates/statistics/index.html src/templates/updates-index.html src/templates/uploads-list.html src/templates/user-comments.html diff --git a/src/buildservice/builds.py b/src/buildservice/builds.py index fcb6792b..7715abb5 100644 --- a/src/buildservice/builds.py +++ b/src/buildservice/builds.py @@ -141,11 +141,6 @@ class Builds(base.Object): return builds - def count(self): - builds = self.db.get("SELECT COUNT(*) AS count FROM builds") - if builds: - return builds.count - def get_obsolete(self, repo=None): """ Get all obsoleted builds. diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index 2a3b493d..1713d244 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -117,30 +117,6 @@ class Jobs(base.Object): return [Job(self.backend, j.id, j) for j in self.db.query(query, *args)] - def get_average_build_time(self): - """ - Returns the average build time of all finished builds from the - last 3 months. - """ - result = self.db.get("SELECT AVG(time_finished - time_started) as average \ - FROM jobs WHERE type = 'build' AND state = 'finished' AND \ - time_finished >= NOW() - '3 months'::interval") - - if result: - return result.average - - def count(self, *states): - query = "SELECT COUNT(*) AS count FROM jobs" - args = [] - - if states: - query += " WHERE state IN %s" - args.append(states) - - jobs = self.db.get(query, *args) - if jobs: - return jobs.count - def restart_failed(self): jobs = self._get_jobs("SELECT jobs.* FROM jobs \ JOIN builds ON builds.id = jobs.build_id \ diff --git a/src/templates/base.html b/src/templates/base.html index 9ac8eed9..28423df0 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -88,13 +88,6 @@ {% end %} -
  • - - - {{ _("Statistics") }} - -
  • - {% if current_user and current_user.is_admin() %}