]> git.ipfire.org Git - pbs.git/commitdiff
Drop useless statistics page
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 25 Oct 2017 17:10:29 +0000 (18:10 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 25 Oct 2017 17:13:07 +0000 (18:13 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
po/POTFILES.in
src/buildservice/builds.py
src/buildservice/jobs.py
src/templates/base.html
src/templates/statistics/index.html [deleted file]
src/web/__init__.py
src/web/handlers.py

index 21797e15b3d45dbf4797228acd35b5c8fb76f517..22f745f35bc6fde8a7445440719ec0df47dd94eb 100644 (file)
@@ -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 = \
index 8745dcd2f25be80e4f64dfa2492873527e5de6eb..e9682c8bbcd7211bd252c3923ff3c76db438fca8 100644 (file)
@@ -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
index fcb6792b8231e549ee45b8f39c0e3a05dac9911a..7715abb58f21dc4c432774ac2e300701786242a8 100644 (file)
@@ -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.
index 2a3b493dd27393918a6477b9135454ec85a1b321..1713d2443ffe91475242ee40ab0b6f6d1a77fa0f 100644 (file)
@@ -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 \
index 9ac8eed94a165d96d0ca5117eb5d370ea5590741..28423df0d2d9f2010208d46749abde439a81b5d8 100644 (file)
                                                                                </li>
                                                                        {% end %}
 
-                                                                       <li>
-                                                                               <a href="/statistics">
-                                                                                       <i class="icon-align-left"></i>
-                                                                                       {{ _("Statistics") }}
-                                                                               </a>
-                                                                       </li>
-
                                                                        {% if current_user and current_user.is_admin() %}
                                                                                <li class="divider"></li>
                                                                                <li class="nav-header">
diff --git a/src/templates/statistics/index.html b/src/templates/statistics/index.html
deleted file mode 100644 (file)
index 312a87e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-{% extends "../base.html" %}
-
-{% block title %}{{ _("Statistics") }}{% end block %}
-
-{% block body %}
-       <div class="page-header">
-               <h2>{{ _("Statistics") }}</h2>
-       </div>
-
-       <p>
-               {{ _("On this page, you will find a lot of information bundled in graphs and figures.") }}
-               {{ _("They give a very quick overview about what is going on in the build service.") }}
-       </p>
-
-       <h3>{{ _("Builds") }}</h3>
-       <ul>
-               <li>
-                       {{ _("The average build time is %.1f minutes.") % (jobs_avg_build_time / 60) }}
-               </li>
-               <li>
-                       {{ _("There are %(builds_count)s builds containing %(jobs_count_all)s jobs.") % { "builds_count" : builds_count, "jobs_count_all" : jobs_count_all } }}
-               </li>
-       </ul>
-{% end block %}
index 99ef809bf30380cb52b45f3e4b945800cc409557..9b3b9b3ff2a607a8ec0878e9e1186ef6210cc06e 100644 (file)
@@ -213,9 +213,6 @@ class Application(tornado.web.Application):
                        (r"/key/([A-Z0-9]+)", KeysDownloadHandler),
                        (r"/key/([A-Z0-9]+)/delete", KeysDeleteHandler),
 
-                       # Statistics
-                       (r"/statistics", StatisticsMainHandler),
-
                        # Documents
                        (r"/documents", DocsIndexHandler),
                        (r"/documents/builds", DocsBuildsHandler),
index 99b35e6fdaf612276c11dcae2cc4baea6e7982c3..9e87889db3d99fbfa03cd15976d74e4e2a8198c3 100644 (file)
@@ -37,24 +37,6 @@ class Error404Handler(BaseHandler):
                raise tornado.web.HTTPError(404)
 
 
-class StatisticsMainHandler(BaseHandler):
-       def get(self):
-               args = {}
-
-               # Build statistics.
-               args.update({
-                       "builds_count" : self.pakfire.builds.count(),
-               })
-
-               # Job statistics.
-               args.update({
-                       "jobs_count_all"      : self.pakfire.jobs.count(),
-                       "jobs_avg_build_time" : self.pakfire.jobs.get_average_build_time(),
-               })
-
-               self.render("statistics/index.html", **args)
-
-
 class UploadsHandler(BaseHandler):
        @tornado.web.authenticated
        def get(self):