Device Detection and IP Intelligence for the 51Degrees Pipeline, in Rust

dd-onprem-performance.rs File Reference

Classes

struct  ExampleOptions
 Options the example runs with. More...

Variables

const USER_AGENTS_RELATIVE_PATH
 The relative path to the User-Agent CSV in the data repository inside the cxx submodule, used when no evidence path is supplied.
const CONTACT_US_URL
 Where to ask about a copy of the Enterprise data file.
const & str
pub struct ExampleOptions u64
 The outcome of one benchmark run.
pub struct ExampleOptions Duration
 The wall-clock time the timed phase took.
pub struct ExampleOptions detections_per_second self f64
 Detections per second across the timed phase, the headline throughput.
pub data_file
 The path to the on-premise Hash data file the engine loads.
pub pub user_agents_file
 The path to a file of User-Agent strings, one per line (the bundled CSV).
pub pub pub thread_count
 How many worker threads run detections in parallel.
pub pub pub pub passes
 How many times to cycle the loaded User-Agent list per thread.
pub pub pub pub pub max_user_agents
 The maximum number of User-Agents to load from the file.
pub pub pub pub pub pub json_output
 Where to write the results JSON the nightly performance graphs read, if anywhere.

Variable Documentation

◆ CONTACT_US_URL

const CONTACT_US_URL

Where to ask about a copy of the Enterprise data file.

◆ data_file

pub data_file

The path to the on-premise Hash data file the engine loads.

◆ Duration

use std::time::Duration

The wall-clock time the timed phase took.

◆ f64

Initial value:
{
let seconds = self.elapsed.as_secs_f64()

Detections per second across the timed phase, the headline throughput.

◆ json_output

pub pub pub pub pub pub json_output

Where to write the results JSON the nightly performance graphs read, if anywhere.

CI passes --json-output <path>; an interactive run leaves it unset and only reads the printed figures.

◆ max_user_agents

pub pub pub pub pub max_user_agents

The maximum number of User-Agents to load from the file.

The bundled file holds 20,000; the test caps this so it stays fast.

◆ passes

pub pub pub pub passes

How many times to cycle the loaded User-Agent list per thread.

A larger multiplier gives a steadier throughput figure.

◆ str

const & str
Initial value:
= &[
("Device Detection", "/device-detection?utm_source=code&utm_medium=example&utm_campaign=51degrees-rust&utm_content=examples-device-detection-examples-src-bin-dd-onprem-performance.rs&utm_term=find-out-more"),
("Pricing", "/pricing?utm_source=code&utm_medium=example&utm_campaign=51degrees-rust&utm_content=examples-device-detection-examples-src-bin-dd-onprem-performance.rs&utm_term=find-out-more"),
("Documentation", "/documentation/index.html?utm_source=code&utm_medium=example&utm_campaign=51degrees-rust&utm_content=examples-device-detection-examples-src-bin-dd-onprem-performance.rs&utm_term=find-out-more"),
]

◆ thread_count

pub pub pub thread_count

How many worker threads run detections in parallel.

◆ u64

pub struct ExampleOptions u64

The outcome of one benchmark run.

How many were detected as mobile, read to keep the optimizer honest.

The total number of detections performed.

◆ user_agents_file

pub pub user_agents_file

The path to a file of User-Agent strings, one per line (the bundled CSV).

◆ USER_AGENTS_RELATIVE_PATH

const USER_AGENTS_RELATIVE_PATH

The relative path to the User-Agent CSV in the data repository inside the cxx submodule, used when no evidence path is supplied.