cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
i_reporter.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
22#include <exception>
23
31
32namespace stat_bench {
33namespace reporter {
34
38class IReporter {
39public:
45 virtual void experiment_starts(
46 const clock::SystemTimePoint& time_stamp) = 0;
47
53 virtual void experiment_finished(
54 const clock::SystemTimePoint& time_stamp) = 0;
55
61 virtual void measurer_starts(const measurer::MeasurerName& name) = 0;
62
68 virtual void measurer_finished(const measurer::MeasurerName& name) = 0;
69
76 virtual void group_starts(const BenchmarkGroupName& name,
77 const bench_impl::BenchmarkGroupConfig& config) = 0;
78
84 virtual void group_finished(const BenchmarkGroupName& name) = 0;
85
91 virtual void case_starts(const BenchmarkFullName& case_info) = 0;
92
98 virtual void case_finished(const BenchmarkFullName& case_info) = 0;
99
106 const measurer::Measurement& measurement) = 0;
107
115 virtual void measurement_failed(const BenchmarkFullName& case_info,
116 const BenchmarkCondition& cond, const std::exception_ptr& error) = 0;
117
118 IReporter(const IReporter&) = delete;
119 IReporter(IReporter&&) = delete;
120 auto operator=(const IReporter&) -> IReporter& = delete;
121 auto operator=(IReporter&&) -> IReporter& = delete;
122
126 virtual ~IReporter() = default;
127
128protected:
132 IReporter() = default;
133};
134
135} // namespace reporter
136} // namespace stat_bench
Definition of BenchmarkCondition class.
Definition of BenchmarkFullName class.
Definition of BenchmarkGroupConfig class.
Definition of BenchmarkGroupName class.
Class of conditions of benchmarks.
Class of information of cases in benchmarks.
Class of names of groups of benchmarks.
Class of configuration of a group of cases in benchmarks.
Class of time points of system clocks.
Class of data of measurements.
Definition measurement.h:42
Class of names of measurers.
virtual void case_starts(const BenchmarkFullName &case_info)=0
Start a case of a benchmark.
virtual void group_finished(const BenchmarkGroupName &name)=0
Finished a group of benchmarks.
virtual void measurer_starts(const measurer::MeasurerName &name)=0
Start benchmarks using a measurer.
virtual void group_starts(const BenchmarkGroupName &name, const bench_impl::BenchmarkGroupConfig &config)=0
Start a group of benchmarks.
virtual void case_finished(const BenchmarkFullName &case_info)=0
Finished a case of a benchmark.
virtual void measurement_succeeded(const measurer::Measurement &measurement)=0
Successfully finished a measurement.
virtual void measurer_finished(const measurer::MeasurerName &name)=0
Finished benchmarks using a measurer.
IReporter()=default
Constructor.
virtual void experiment_finished(const clock::SystemTimePoint &time_stamp)=0
Finished an experiment.
virtual ~IReporter()=default
Destructor.
virtual void measurement_failed(const BenchmarkFullName &case_info, const BenchmarkCondition &cond, const std::exception_ptr &error)=0
Failed a measurement.
virtual void experiment_starts(const clock::SystemTimePoint &time_stamp)=0
Start an experiment.
Definition of Measurement class.
Definition of MeasurerName class.
Namespace of reporters of results of benchmarks.
Namespace of stat_bench source codes.
Definition of SystemTimePoint class.