Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unity::scopes::testing::InProcessBenchmark Class Reference

The InProcessBenchmark class provides scope authors with runtime benchmarking capabilities. The actual runs are executed in the same process. More...

#include <unity/scopes/testing/InProcessBenchmark.h>

Inheritance diagram for unity::scopes::testing::InProcessBenchmark:

Public Member Functions

virtual Result for_query (const std::shared_ptr< unity::scopes::ScopeBase > &scope, QueryConfiguration configuration) override
 for_query executes a benchmark to measure the scope's query performance. More...
 
virtual Result for_preview (const std::shared_ptr< unity::scopes::ScopeBase > &scope, PreviewConfiguration preview_configuration) override
 for_preview executes a benchmark to measure the scope's preview performance. More...
 
virtual Result for_activation (const std::shared_ptr< unity::scopes::ScopeBase > &scope, ActivationConfiguration activation_configuration) override
 for_preview executes a benchmark to measure the scope's activation performance. More...
 
virtual Result for_action (const std::shared_ptr< unity::scopes::ScopeBase > &scope, ActionConfiguration activation_configuration) override
 for_preview executes a benchmark to measure the scope's action activation performance. More...
 

Detailed Description

The InProcessBenchmark class provides scope authors with runtime benchmarking capabilities. The actual runs are executed in the same process.

unity::scopes::Query query{scope_id};
query.set_query_string(scope_query_string);
unity::scopes::SearchMetadata meta_data{default_locale, default_form_factor};
config.sampler = [query, meta_data]()
{
return std::make_pair(query, meta_data);
};
auto result = benchmark.for_query(scope, config);

Member Function Documentation

virtual Result unity::scopes::testing::InProcessBenchmark::for_action ( const std::shared_ptr< unity::scopes::ScopeBase > &  scope,
ActionConfiguration  configuration 
)
overridevirtual

for_preview executes a benchmark to measure the scope's action activation performance.

Exceptions
std::runtime_errorin case of timeouts.
std::logic_errorin case of misconfiguration.
Parameters
scopeThe scope instance to benchmark.
configurationOptions controlling the experiment.
Returns
An instance of Result.

Implements unity::scopes::testing::Benchmark.

Reimplemented in unity::scopes::testing::OutOfProcessBenchmark.

virtual Result unity::scopes::testing::InProcessBenchmark::for_activation ( const std::shared_ptr< unity::scopes::ScopeBase > &  scope,
ActivationConfiguration  configuration 
)
overridevirtual

for_preview executes a benchmark to measure the scope's activation performance.

Exceptions
std::runtime_errorin case of timeouts.
std::logic_errorin case of misconfiguration.
Parameters
scopeThe scope instance to benchmark.
configurationOptions controlling the experiment.
Returns
An instance of Result.

Implements unity::scopes::testing::Benchmark.

Reimplemented in unity::scopes::testing::OutOfProcessBenchmark.

virtual Result unity::scopes::testing::InProcessBenchmark::for_preview ( const std::shared_ptr< unity::scopes::ScopeBase > &  scope,
PreviewConfiguration  configuration 
)
overridevirtual

for_preview executes a benchmark to measure the scope's preview performance.

Exceptions
std::runtime_errorin case of timeouts.
std::logic_errorin case of misconfiguration.
Parameters
scopeThe scope instance to benchmark.
configurationOptions controlling the experiment.
Returns
An instance of Result.

Implements unity::scopes::testing::Benchmark.

Reimplemented in unity::scopes::testing::OutOfProcessBenchmark.

virtual Result unity::scopes::testing::InProcessBenchmark::for_query ( const std::shared_ptr< unity::scopes::ScopeBase > &  scope,
QueryConfiguration  configuration 
)
overridevirtual

for_query executes a benchmark to measure the scope's query performance.

Exceptions
std::runtime_errorin case of timeouts.
std::logic_errorin case of misconfiguration.
Parameters
scopeThe scope instance to benchmark.
configurationOptions controlling the experiment.
Returns
An instance of Result.

Implements unity::scopes::testing::Benchmark.

Reimplemented in unity::scopes::testing::OutOfProcessBenchmark.


The documentation for this class was generated from the following file: