Exemplo n.º 1
0
def compare_line_lmrtt_by_isp(max_results,isp,country,earliest,latest):	
	result = []
	#all devices under given isp:
	devices = database_helper.get_details_by_isp(isp)
	if country!='none':
		devices = devices.filter(geoip_country=country)
	for d in devices:
		if d.geoip_city!='' and d.geoip_city!=None:
			data = []
			if len(result)<max_results:
				try:
					data = data_helper.parse_lmrtt_compare(d.deviceid,earliest,latest,d.geoip_city)
				except:
					continue
				#no measurements:
				if len(data['data'])==0:
					continue
				result.append(data)
	#sort series alpahetically:
	result = sorted(result, key = lambda x: x['name'].lstrip())
	return result
Exemplo n.º 2
0
def compare_line_lmrtt_by_isp(max_results, isp, country, earliest, latest):
    result = []
    #all devices under given isp:
    devices = database_helper.get_details_by_isp(isp)
    if country != 'none':
        devices = devices.filter(geoip_country=country)
    for d in devices:
        if d.geoip_city != '' and d.geoip_city != None:
            data = []
            if len(result) < max_results:
                try:
                    data = data_helper.parse_lmrtt_compare(
                        d.deviceid, earliest, latest, d.geoip_city)
                except:
                    continue
                #no measurements:
                if len(data['data']) == 0:
                    continue
                result.append(data)
    #sort series alpahetically:
    result = sorted(result, key=lambda x: x['name'].lstrip())
    return result
Exemplo n.º 3
0
def compare_line_bitrate_by_isp(max_results,isp,country,direction,earliest,latest):
	result = []
	#all devices under given isp:
	devices = database_helper.get_details_by_isp(isp)
	#if country is specified, only devices for the given ISP and country are shown:
	if country!='none':
		devices = devices.filter(geoip_country=country)
	for d in devices:
		if d.geoip_city!='' and d.geoip_city!=None:
			data = []
			if len(result)<max_results:
				try:
					data = data_helper.parse_bitrate_compare(d.deviceid,earliest,latest,direction,d.geoip_city)
				except:
					continue
				#no measurements:
				if len(data['data'])==0:
					continue
				result.append(data)
	#order series alphabetically:
	result = sorted(result, key = lambda x: x['name'].lstrip())
	return result
Exemplo n.º 4
0
def compare_line_bitrate_by_isp(max_results, isp, country, direction, earliest,
                                latest):
    result = []
    #all devices under given isp:
    devices = database_helper.get_details_by_isp(isp)
    #if country is specified, only devices for the given ISP and country are shown:
    if country != 'none':
        devices = devices.filter(geoip_country=country)
    for d in devices:
        if d.geoip_city != '' and d.geoip_city != None:
            data = []
            if len(result) < max_results:
                try:
                    data = data_helper.parse_bitrate_compare(
                        d.deviceid, earliest, latest, direction, d.geoip_city)
                except:
                    continue
                #no measurements:
                if len(data['data']) == 0:
                    continue
                result.append(data)
    #order series alphabetically:
    result = sorted(result, key=lambda x: x['name'].lstrip())
    return result