]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Drop ETA guessing which was never really accurate
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 22 Oct 2017 13:03:56 +0000 (14:03 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 22 Oct 2017 13:03:56 +0000 (14:03 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/jobs.py
src/templates/jobs-detail.html
src/web/__init__.py

index 0d0dec99da1a0198664f1ca1b1bcd39ee7b58f07..7de41256f49dc30cb48af161616f0f03b050f122 100644 (file)
@@ -438,28 +438,6 @@ class Job(base.DataObject):
        def time_finished(self):
                return self.data.time_finished
 
-       @property
-       def expected_runtime(self):
-               """
-                       Returns the estimated time and stddev, this job takes to finish.
-               """
-               # Get the average build time.
-               build_times = self.backend.builds.get_build_times_by_arch(self.arch,
-                       name=self.pkg.name)
-
-               # If there is no statistical data, we cannot estimate anything.
-               if not build_times:
-                       return None, None
-
-               return build_times.average, build_times.stddev
-
-       @property
-       def eta(self):
-               expected_runtime, stddev = self.expected_runtime
-
-               if expected_runtime:
-                       return expected_runtime - int(self.duration), stddev
-
        def get_pkg_by_uuid(self, uuid):
                pkg = self.backend.packages._get_package("SELECT packages.id FROM packages \
                        JOIN jobs_packages ON jobs_packages.pkg_id = packages.id \
index 9a6fb14a0c38d626ca1d2fb5bc55552817035ca0..9d605d5d1cfd5e181eb446721924e7928ba21bcb 100644 (file)
                                                                        {{ format_date(job.time_finished, full_format=True) }}
                                                                </p>
                                                        {% end %}
-                                                       {% if job.is_running() %}
-                                                               <p>
-                                                                       <strong>{{ _("ETA") }}</strong><br>
-                                                                       {{ format_eta(job.eta) }}
-                                                               </p>
-                                                       {% end %}
                                        </div>
                                </div>
                        </div>
index 4082b8e8881284ca2f2632d0c4b99282829fc9c5..8bcd6896e31f562e4db1a2b0ea0dc44ce7f71bd7 100644 (file)
@@ -89,7 +89,6 @@ class Application(tornado.web.Application):
                                "SelectTimezone"     : ui_modules.SelectTimezoneModule,
                        },
                        ui_methods = {
-                               "format_eta"         : self.format_eta,
                                "format_time"        : self.format_time,
                        },
                        xsrf_cookies = True,
@@ -285,19 +284,6 @@ class Application(tornado.web.Application):
 
        ## UI methods
 
-       def format_eta(self, handler, (s, stddev)):
-               if s is None:
-                       _ = handler.locale.translate
-                       return _("Unknown")
-
-               if s < 0:
-                       s = 0
-
-               return u"%s ± %s" % (
-                       self.format_time(handler, s),
-                       self.format_time_short(handler, stddev / 2),
-               )
-
        def format_time(self, handler, s, shorter=False):
                _ = handler.locale.translate