def get_hosts_and_tests():
 host_info = {}
 q = ((((dbmodels.Q(test_name__startswith='kernbench') | dbmodels.Q(test_name__startswith='dbench')) | dbmodels.Q(test_name__startswith='tbench')) | dbmodels.Q(test_name__startswith='unixbench')) | dbmodels.Q(test_name__startswith='iozone'))
 test_query = models.TestView.objects.filter(q).values('test_name', 'hostname', 'machine_idx').distinct()
 for result_dict in test_query:
  hostname = result_dict['hostname']
  test = result_dict['test_name']
  machine_idx = result_dict['machine_idx']
  host_info.setdefault(hostname, {})
  host_info[hostname].setdefault('tests', [])
  host_info[hostname]['tests'].append(test)
  host_info[hostname]['id'] = machine_idx
 return rpc_utils.prepare_for_serialization(host_info)

def get_hosts_and_tests ( ) : host_info = { } q = ( ( ( ( dbmodels . Q ( test_name__startswith = 'kernbench' ) | dbmodels . Q ( test_name__startswith = 'dbench' ) ) | dbmodels . Q ( test_name__startswith = 'tbench' ) ) | dbmodels . Q ( test_name__startswith = 'unixbench' ) ) | dbmodels . Q ( test_name__startswith = 'iozone' ) ) test_query = models . TestView . objects . filter ( q ) . values ( 'test_name' , 'hostname' , 'machine_idx' ) . distinct ( ) for result_dict in test_query : hostname = result_dict [ 'hostname' ] test = result_dict [ 'test_name' ] machine_idx = result_dict [ 'machine_idx' ] host_info . setdefault ( hostname , { } ) host_info [ hostname ] . setdefault ( 'tests' , [ ] ) host_info [ hostname ] [ 'tests' ] . append ( test ) host_info [ hostname ] [ 'id' ] = machine_idx return rpc_utils . prepare_for_serialization ( host_info )
gets every host that has had a benchmark run on it .