Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qbenchmarkmeasurement_p.h
Go to the documentation of this file.
1
// Copyright (C) 2019 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QBENCHMARKMEASUREMENT_P_H
5
#
define
QBENCHMARKMEASUREMENT_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtTest
/
qbenchmark
.
h
>
19
#
include
<
QtCore
/
qlist
.
h
>
20
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
21
#
include
<
QtTest
/
private
/
qmeanvarianceaccumulator_p
.
h
>
22
23
QT_BEGIN_NAMESPACE
24
25
class
QBenchmarkMeasurerBase
26
{
27
public
:
28
struct
Measurement
29
{
30
qreal value;
31
qreal variance;
32
QTest::QBenchmarkMetric metric;
33
};
34
virtual
~QBenchmarkMeasurerBase() =
default
;
35
virtual
void
start() = 0;
36
virtual
void
resetMetricsResults() { accumulator.reset(); }
37
virtual
void
updateMeasurement() {}
38
virtual
QList<Measurement> stop() = 0;
39
virtual
bool
isMeasurementAccepted(Measurement m) = 0;
40
virtual
int
adjustIterationCount(
int
suggestion) = 0;
41
virtual
int
adjustMedianCount(
int
suggestion) = 0;
42
virtual
bool
needsWarmupIteration() {
return
false
; }
43
QTestPrivate::MeanAndVarianceAccumulator accumulator;
44
};
45
46
QT_END_NAMESPACE
47
48
#
endif
// QBENCHMARKMEASUREMENT_P_H
qtbase
src
testlib
qbenchmarkmeasurement_p.h
Generated on
for Qt by
1.18.0