This class provides support for output of multi‐threaded performance benchmark results. The results are counts of work done during the benchmark time period divided by the time period.

Synopsis

Declared in <bslmt_throughputbenchmarkresult.h>

class ThroughputBenchmarkResult;

Type Aliases

Name

Description

DoubleVector

Vector of double values used to store throughput measurements.

Int64

Signed 64‐bit integer type used for result counts.

Member Functions

Name

Description

ThroughputBenchmarkResult [constructor]

Constructors

operator=

Assignment operators

allocator

Return the allocator used by this object.

getMedian

Load into the specified median the median throughput (count / second) of the work done by all the threads in the specified threadGroupIndex. The behavior is undefined unless 0 <= threadGroupIndex < numThreadGroups.

getPercentile

Load into the specified percentile the specified percentage throughput (count / second) of the work done by all the threads in the specified threadGroupIndex. A percentage of 0.0 is the minimum, and a percentage of 1.0 is the maximum. The behavior is undefined unless 0 <= threadGroupIndex < numThreadGroups and 0.0 <= percentage <= 1.0.

getPercentiles

Load into the specified percentiles vector a uniform breakdown of percentage throughput (count / second) of the work done by all the threads in the specified threadGroupIndex. The size of percentiles controls how many percentages are provided. For example, a size of 5 will return the percentages 0, 0.25, 0.5, 0.75, 1. The behavior is undefined unless 0 <= threadGroupIndex < numThreadGroups and 2 <= percentiles‐>size().

getThreadPercentiles

Load into the specified percentiles vector of vectors a uniform breakdown of percentage throughput (count / second) of the work done on the specified threadGroupIndex for each of the threads in it. The size of percentiles controls how many percentages are provided. For example, a size of 5 will return the percentages 0, 0.25, 0.5, 0.75, 1. The size of each of the vectors inside stats must be numThreads(threadGroupId). The behavior is undefined unless 0 <= threadGroupId < numThreadGroups, 2 <= percentiles.size(), and percentiles[N].size() == numThreads(threadGroupIndex) for all N.

getValue

Return the throughput of work done on the specified threadIndex thread, in the specified threadGroupIndex, and the specified sampleIndex sample. The behavior is undefined unless 0 <= threadIndex < numThreads(threadGroupIndex), 0 <= threadGroupIndex < numThreadGroups(), and 0 <= sampleIndex < numSamples().

initialize

Initialize a default constructed ThroughputBenchmarkResult object with the specified numSamples number of samples in the benchmark, and the specified threadGroupSizes, the number of threads in each of the thread groups. If any data was previously kept, it is lost. The behavior is undefined unless 0 < numSamples, 0 < threadGroupSizes.size(), and 0 < threadGroupSizes[N] for all valid N.

numSamples

Return the number of test samples.

numThreadGroups

Return the number of thread groups.

numThreads

Return the number of threads in the specified threadGroupIdx. The behavior is undefined unless 0 <= threadGroupIndex < numThreadGroups().

setThroughput

Set the throughput related to the specified threadIndex thread, in the specified threadGroupIndex, and the specified sampleIndex to the specified value. The behavior is undefined unless 0 <= value, 0 <= threadIndex < numThreads(threadGroupIndex), 0 <= threadGroupIndex < numThreadGroups(), and 0 <= sampleIndex < numSamples().

totalNumThreads

Return the total number of threads.

operator BloombergLP::bslmf::NestedTraitDeclaration<ThroughputBenchmarkResult, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Friends

Name

Description

BloombergLP::bslmt::ThroughputBenchmarkResult_TestUtil

This component‐private class provides modifiable access to the non‐public attributes of a ThroughPutBenchmarkResult object supplied on construction, and is provided for use exclusively in the test driver of this component.

Created with MrDocs