示例#1
0
def compare_line_lmrtt_by_city(max_results, city, earliest, latest):
	result = []
	#all devices for given city
	devices = database_helper.get_details_by_city(city)
	for d in devices:
		if d.geoip_isp!='' and d.geoip_isp!=None:
			data = []
			if len(result)<max_results:
				try:
					data = data_helper.parse_lmrtt_compare(d.deviceid,earliest,latest,d.geoip_isp)
				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
示例#2
0
def compare_line_lmrtt_by_city(max_results, city, earliest, latest):
    result = []
    #all devices for given city
    devices = database_helper.get_details_by_city(city)
    for d in devices:
        if d.geoip_isp != '' and d.geoip_isp != None:
            data = []
            if len(result) < max_results:
                try:
                    data = data_helper.parse_lmrtt_compare(
                        d.deviceid, earliest, latest, d.geoip_isp)
                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
示例#3
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
示例#4
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