def TryChooserGetEndtoEndTimes(starttime=None, endtime=None, branch_name='mozilla-central'): """Get end to end times report for the speficied time interval and branch. Input: starttime - start time (UNIX timestamp in seconds), if not specified, endtime minus 24 hours endtime - end time (UNIX timestamp in seconds), if not specified, starttime plus 24 hours or current time (if starttime is not specified either) branch_name - branch name, default vaue is 'mozilla-central' Output: EndtoEndTimesReport """ starttime, endtime = get_time_interval(starttime, endtime) q = BuildRequestsQuery(starttime=starttime, endtime=endtime, branch_name=branch_name) q_results = q.execute() report = TryChooserEndtoEndTimesReport(starttime, endtime, branch_name) for r in q_results: params = dict((str(k), v) for (k, v) in dict(r).items()) br = BuildRequest(**params) report.add_build_request(br) return report
def BuildersTypeQuery(starttime, endtime, buildername): """Constructs the sqlalchemy query for fetching all build requests in the specified time interval for the specified buildername. Input: starttime - start time, UNIX timestamp (in seconds) endtime - end time, UNIX timestamp (in seconds) buildername - builder's name Output: query """ br = meta.scheduler_db_meta.tables['buildrequests'] q = BuildRequestsQuery(starttime=starttime, endtime=endtime) q = q.where(br.c.buildername.like(buildername)) return q
def BuildersQuery(starttime, endtime, branch_name): """Constructs the sqlalchemy query for fetching all build requests in the specified time interval for the specified branch. Input: starttime - start time, UNIX timestamp (in seconds) endtime - end time, UNIX timestamp (in seconds) branch_name - branch name Output: query """ return BuildRequestsQuery(starttime=starttime, endtime=endtime, branch_name=branch_name)