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

ExampleOptions Struct Reference

Detailed Description

Options the example runs with.

The options that drive a run of this example.

Options the example runs with, so main and the test share one entry point.

Holding the inputs in one struct lets main and the test feed the same run entry point.

Keeping the inputs in one struct lets main (reading the environment and the command line) and the test (supplying fixed values) share the same [run] entry point.

Public Attributes

pub resource_key: String
 The cloud resource key created in the configurator.
pub pub endpoint: Option<String>
 An optional override for the cloud endpoint.
pub pub pub cloud_request_origin: Option<String>
 The cloud request origin to send.
pub pub pub user_agent: String
 The User-Agent to detect and dump every property for.
pub pub pub native_models: Vec<String>
 The native model names to look up. Defaults to [SAMPLE_NATIVE_MODELS].
pub pub pub tacs: Vec<String>
 The TACs to look up. Defaults to [SAMPLE_TACS].
pub data_file: PathBuf
 The path to the on-premise Hash data file the engine loads.
pub pub profile: PerformanceProfile
 The performance profile to load the data file with.
pub pub timing_iterations: usize
 How many detections to run when timing the "fewer properties is faster" comparison.
pub pub evidence_file: PathBuf
 The path to the YAML evidence file to read records from.
pub pub pub output_file: PathBuf
 The path to write the YAML results to.
pub pub pub pub max_records: usize
 The maximum number of records to process.
pub pub user_agents_file: PathBuf
 The path to a file of User-Agent strings, one per line (the bundled CSV).
pub pub pub thread_count: usize
 How many worker threads run detections in parallel.
pub pub pub pub passes: usize
 How many times to cycle the loaded User-Agent list per thread.
pub pub pub pub pub max_user_agents: usize
 The maximum number of User-Agents to load from the file.
pub pub pub pub pub pub json_output: Option<PathBuf>
 Where to write the results JSON the nightly performance graphs read, if anywhere.
pub pub profiles: Vec<PerformanceProfile>
 The performance profiles to compare results across.
pub pub pub ips: (String
 The two IP addresses to compare side by side.
pub pub pub String
pub pub pub pub profile: PerformanceProfile
 The performance profile the two IP addresses are compared under.
pub data_files: Vec<PathBuf>
 The full paths to the .ipi data files to open, each looked up in turn.
pub pub ips: Vec<String>
 The IP addresses to look up, as client-IP evidence values.
pub pub pub profile: PerformanceProfile
 The performance profile the pipeline is built with.
pub pub pub max_records: usize
 The maximum number of records to process (the evidence file holds many).
pub pub pub pub max_ips: usize
 The maximum number of distinct IP addresses to load from the evidence file.
pub pub pub pub pub iterations: usize
 How many times each thread loops over the loaded IP set.

Member Data Documentation

◆ cloud_request_origin

pub pub pub ExampleOptions::cloud_request_origin

The cloud request origin to send.

Defaults to [CLOUD_REQUEST_ORIGIN]. Set to None to send no origin header.

◆ data_file

pub ExampleOptions::data_file

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

The full path to the .ipi data file to open.

◆ data_files

pub ExampleOptions::data_files

The full paths to the .ipi data files to open, each looked up in turn.

◆ endpoint

pub pub ExampleOptions::endpoint

An optional override for the cloud endpoint.

◆ evidence_file

pub pub ExampleOptions::evidence_file

The path to the YAML evidence file to read records from.

The full path to the YAML evidence file to read.

◆ ips [1/2]

pub pub ExampleOptions::ips

The two IP addresses to compare side by side.

The IP addresses to assess, as client-IP evidence values.

The IP addresses to look up and time.

◆ ips [2/2]

pub pub ExampleOptions::ips

The IP addresses to look up, as client-IP evidence values.

The IP addresses to assess, as client-IP evidence values.

The IP addresses to look up and time.

◆ iterations

pub pub pub pub pub ExampleOptions::iterations

How many times each thread loops over the loaded IP set.

◆ json_output

pub pub pub pub pub pub ExampleOptions::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_ips

pub pub pub pub ExampleOptions::max_ips

The maximum number of distinct IP addresses to load from the evidence file.

Each thread loops over the loaded set.

◆ max_records [1/2]

pub pub pub pub ExampleOptions::max_records

The maximum number of records to process.

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

◆ max_records [2/2]

pub pub pub ExampleOptions::max_records

The maximum number of records to process (the evidence file holds many).

◆ max_user_agents

pub pub pub pub pub ExampleOptions::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.

◆ native_models

pub pub pub ExampleOptions::native_models

The native model names to look up. Defaults to [SAMPLE_NATIVE_MODELS].

◆ output_file

pub pub pub ExampleOptions::output_file

The path to write the YAML results to.

◆ passes

pub pub pub pub ExampleOptions::passes

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

A larger multiplier gives a steadier throughput figure.

◆ profile [1/3]

pub pub ExampleOptions::profile

The performance profile to load the data file with.

The example uses the low-memory profile, whose performance is sufficient here.

◆ profile [2/3]

pub pub pub pub ExampleOptions::profile

The performance profile the two IP addresses are compared under.

◆ profile [3/3]

pub pub pub ExampleOptions::profile

The performance profile the pipeline is built with.

◆ profiles

pub pub ExampleOptions::profiles

The performance profiles to compare results across.

◆ resource_key

pub ExampleOptions::resource_key

The cloud resource key created in the configurator.

The cloud resource key. TAC lookup requires a paid subscription.

The cloud resource key. Native model lookup requires a paid subscription.

The cloud resource key whose metadata is listed.

The cloud resource key the pipeline authenticates with.

◆ String

pub pub pub ExampleOptions::String

◆ tacs

pub pub pub ExampleOptions::tacs

The TACs to look up. Defaults to [SAMPLE_TACS].

◆ thread_count

pub pub pub ExampleOptions::thread_count

How many worker threads run detections in parallel.

How many worker threads to run the multi-threaded pass with.

◆ timing_iterations

pub pub ExampleOptions::timing_iterations

How many detections to run when timing the "fewer properties is faster" comparison.

Kept small in tests, larger from main for a steadier signal.

◆ user_agent

pub pub pub ExampleOptions::user_agent

The User-Agent to detect and dump every property for.

◆ user_agents_file

pub pub ExampleOptions::user_agents_file

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