Device detection services for 51Degrees Pipeline

fiftyone.devicedetection.examples.console.comparison.Comparer Class Reference

Detailed Description

Unlike other examples, use of this example requires a 51Degrees Enterprise data file, which can be obtained on a trial basis or purchased from our pricing page here.

This class provides a framework and runner for comparing different device detection solutions. It is provided in a basic form to compare detection time. Different solutions may be compared by implementing the interfaces in Detection. In this example we have provided such implementations for 51Degrees and BrowsCap, and skeleton commented-out implementations for ScientiaMobile (WURFL) and DeviceAtlas. We don't have access to those APIs so the code has not been tested and it is left to those interested to uncomment and get working.

Collaboration diagram for fiftyone.devicedetection.examples.console.comparison.Comparer:

[legend]

Classes

class  Benchmark
 Implementation of the benchmark for a single thread.
class  ExecutionResult
 A list of BenchmarkResult, one per thread, and the elapsed time between starting the threads and them all completing.

Public Member Functions

void compare (List< Solution > solutions, int numberOfThreads, int numberOfResults, Reporting reportingModel, PrintWriter writer) throws Exception
 Execute the benchmarks using the solutions provided.
List< BenchmarkResult > runBenchmarks (Solution solution) throws Exception
 Initiate the benchmark threads.

Static Public Member Functions

static void main (String[] args) throws Exception

Static Public Attributes

static final int DEFAULT_NUMBER_OF_THREADS = 4
static final int DEFAULT_NUMBER_OF_RESULTS = 2500
static final Solution[] DEFAULT_SOLUTIONS

Member Function Documentation

◆ compare()

void fiftyone.devicedetection.examples.console.comparison.Comparer.compare ( List< Solution > solutions,
int numberOfThreads,
int numberOfResults,
Reporting reportingModel,
PrintWriter writer ) throws Exception

Execute the benchmarks using the solutions provided.

Parameters
solutionssome solutions
numberOfThreadshow many threads to run for each solution
numberOfResultshow many detections to do per thread
reportingModelhow and what to report
writerwhere to report it
Exceptions
Exceptionto satisfy underlying APIs

◆ runBenchmarks()

List< BenchmarkResult > fiftyone.devicedetection.examples.console.comparison.Comparer.runBenchmarks ( Solution solution) throws Exception

Initiate the benchmark threads.

Parameters
solutionthe solution being benchmarked
Returns
result of the benchmark
Exceptions
Exceptionto satisfy called APIs

Member Data Documentation

◆ DEFAULT_SOLUTIONS

final Solution [] fiftyone.devicedetection.examples.console.comparison.Comparer.DEFAULT_SOLUTIONS
static