Device Detection services for 51Degrees Pipeline

fiftyone_devicedetection_examples.onpremise.performance Namespace Reference

Functions

 process_user_agent (user_agent)
 process_user_agent_list (data_file, user_agent_list, list_number, output, skip=False)
 run (data_file, skip=False)

Variables

str CONTACT_US = "/contact-us?utm_source=code&utm_medium=example&utm_campaign=51degrees-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-onpremise-performance.py&utm_term=enterprise-data-file"
int threads = 0
 split_lists = None
 ap = argparse.ArgumentParser(description='Run detection benchmark.')
 default
 help
 args = ap.parse_args()
 data_file
 user_agents_file
 newline
 reader = csv.reader(file)
 user_agents = list(reader)
 number_of_user_agents = len(user_agents)
 chunk_size = int(number_of_user_agents / threads)
 calibration = run(args.data_file, skip=True)
 real = run(args.data_file, skip=False)
 real_time = real["time"]
dict results
 file
dict final_result
 data_file_path
 licence_keys
 performance_profile
 add_javascript_builder
 usage_sharing
 auto_update

Function Documentation

◆ process_user_agent()

process_user_agent ( user_agent)

◆ process_user_agent_list()

process_user_agent_list ( data_file,
user_agent_list,
list_number,
output,
skip = False )

◆ run()

run ( data_file,
skip = False )

Variable Documentation

◆ add_javascript_builder

fiftyone_devicedetection_examples.onpremise.performance.add_javascript_builder

◆ ap

fiftyone_devicedetection_examples.onpremise.performance.ap = argparse.ArgumentParser(description='Run detection benchmark.')

◆ args

fiftyone_devicedetection_examples.onpremise.performance.args = ap.parse_args()

◆ auto_update

fiftyone_devicedetection_examples.onpremise.performance.auto_update

◆ calibration

fiftyone_devicedetection_examples.onpremise.performance.calibration = run(args.data_file, skip=True)

◆ chunk_size

fiftyone_devicedetection_examples.onpremise.performance.chunk_size = int(number_of_user_agents / threads)

◆ CONTACT_US

str fiftyone_devicedetection_examples.onpremise.performance.CONTACT_US = "/contact-us?utm_source=code&utm_medium=example&utm_campaign=51degrees-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-onpremise-performance.py&utm_term=enterprise-data-file"

◆ data_file

fiftyone_devicedetection_examples.onpremise.performance.data_file

◆ data_file_path

fiftyone_devicedetection_examples.onpremise.performance.data_file_path

◆ default

fiftyone_devicedetection_examples.onpremise.performance.default

◆ file

fiftyone_devicedetection_examples.onpremise.performance.file

◆ final_result

dict fiftyone_devicedetection_examples.onpremise.performance.final_result
Initial value:
= {
"mobile": 0,
"notmobile": 0,
"unknown": 0
}

◆ help

fiftyone_devicedetection_examples.onpremise.performance.help

◆ licence_keys

fiftyone_devicedetection_examples.onpremise.performance.licence_keys

◆ newline

fiftyone_devicedetection_examples.onpremise.performance.newline

◆ number_of_user_agents

fiftyone_devicedetection_examples.onpremise.performance.number_of_user_agents = len(user_agents)

◆ performance_profile

fiftyone_devicedetection_examples.onpremise.performance.performance_profile

◆ reader

fiftyone_devicedetection_examples.onpremise.performance.reader = csv.reader(file)

◆ real

fiftyone_devicedetection_examples.onpremise.performance.real = run(args.data_file, skip=False)

◆ real_time

fiftyone_devicedetection_examples.onpremise.performance.real_time = real["time"]

◆ results

dict fiftyone_devicedetection_examples.onpremise.performance.results
Initial value:
= {
"DetectionsPerSecond": 1.0 / (real_time / number_of_user_agents),
"MsPerDetection": real_time * 1000 / number_of_user_agents
}

◆ split_lists

list split_lists = None

◆ threads

fiftyone_devicedetection_examples.onpremise.performance.threads = 0

◆ usage_sharing

fiftyone_devicedetection_examples.onpremise.performance.usage_sharing

◆ user_agents

fiftyone_devicedetection_examples.onpremise.performance.user_agents = list(reader)

◆ user_agents_file

fiftyone_devicedetection_examples.onpremise.performance.user_agents_file