cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
console_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// IWYU pragma: no_include <cwchar>
23
24#include <cstdio>
25
27
28namespace stat_bench {
29namespace reporter {
30
34class ConsoleReporter final : public IReporter {
35public:
41 explicit ConsoleReporter(std::FILE* file = stdout);
42
44 void experiment_starts(const clock::SystemTimePoint& time_stamp) override;
45
47 void experiment_finished(const clock::SystemTimePoint& time_stamp) override;
48
50 void measurer_starts(const measurer::MeasurerName& name) override;
51
53 void measurer_finished(const measurer::MeasurerName& name) override;
54
56 void group_starts(const BenchmarkGroupName& name,
57 const bench_impl::BenchmarkGroupConfig& config) override;
58
60 void group_finished(const BenchmarkGroupName& name) override;
61
63 void case_starts(const BenchmarkFullName& case_info) override;
64
66 void case_finished(const BenchmarkFullName& case_info) override;
67
70 const measurer::Measurement& measurement) override;
71
73 void measurement_failed(const BenchmarkFullName& case_info,
74 const BenchmarkCondition& cond,
75 const std::exception_ptr& error) override;
76
77private:
79 std::FILE* file_;
80};
81
82} // namespace reporter
83} // namespace stat_bench
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.
void group_starts(const BenchmarkGroupName &name, const bench_impl::BenchmarkGroupConfig &config) override
Start a group of benchmarks.
void measurement_succeeded(const measurer::Measurement &measurement) override
Successfully finished a measurement.
void experiment_starts(const clock::SystemTimePoint &time_stamp) override
Start an experiment.
void experiment_finished(const clock::SystemTimePoint &time_stamp) override
Finished an experiment.
void case_starts(const BenchmarkFullName &case_info) override
Start a case of a benchmark.
void measurer_starts(const measurer::MeasurerName &name) override
Start benchmarks using a measurer.
void measurement_failed(const BenchmarkFullName &case_info, const BenchmarkCondition &cond, const std::exception_ptr &error) override
Failed a measurement.
ConsoleReporter(std::FILE *file=stdout)
Constructor.
void measurer_finished(const measurer::MeasurerName &name) override
Finished benchmarks using a measurer.
void group_finished(const BenchmarkGroupName &name) override
Finished a group of benchmarks.
void case_finished(const BenchmarkFullName &case_info) override
Finished a case of a benchmark.
Definition of IReporter class.
Namespace of reporters of results of benchmarks.
Namespace of stat_bench source codes.