]> git.ipfire.org Git - people/jschlag/pbs.git/blobdiff - src/hub/handlers.py
jobs: Drop type field and replace it by test field
[people/jschlag/pbs.git] / src / hub / handlers.py
index d38ebc0ec1758ce8263b554526e85311cba34404..0f63b65ea1ad8af9929cea59581a58b3e64740ac 100644 (file)
@@ -135,48 +135,6 @@ class ErrorTestHandler(BaseHandler):
                raise tornado.web.HTTPError(error_code)
 
 
-class StatsBuildsTypesHandler(BaseHandler):
-       def get(self):
-               ret = {}
-
-               types = self.backend.builds.get_types_stats()
-               for type, count in types.items():
-                       ret["builds_type_%s" % type] = count
-
-               self.write(ret)
-
-
-class StatsJobsHandler(BaseHandler):
-       def get(self):
-               ret = {}
-
-               self.write(ret)
-
-
-class StatsJobsStatesHandler(BaseHandler):
-       def get(self):
-               ret = {}
-
-               states = self.backend.jobs.get_state_stats()
-               for state, count in states.items():
-                       ret["jobs_state_%s" % state] = count
-
-               self.write(ret)
-
-
-class StatsJobsQueueHandler(BaseHandler):
-       def get(self):
-               ret = {}
-
-               # Queue length(s).
-               ret["job_queue_length"] = len(self.backend.jobqueue)
-
-               # Average waiting time.
-               ret["job_queue_avg_wait_time"] = self.backend.jobqueue.average_waiting_time
-
-               self.write(ret)
-
-
 # Uploads
 
 class UploadsCreateHandler(BaseHandler):
@@ -382,7 +340,7 @@ class JobsBaseHandler(BaseHandler):
                        "packages"     : [p.uuid for p in job.packages],
                        "state"        : job.state,
                        "time_created" : job.time_created.isoformat(),
-                       "type"         : job.type,
+                       "type"         : "test" if job.test else "release",
                        "uuid"         : job.uuid,
                }
 
@@ -606,7 +564,7 @@ class BuildersJobsQueueHandler(BuildersBaseHandler):
                                "arch"               : job.arch,
                                "source_url"         : job.build.source_download,
                                "source_hash_sha512" : job.build.source_hash_sha512,
-                               "type"               : job.type,
+                               "type"               : "test" if job.test else "release",
                                "config"             : job.get_config(),
                        }