cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
data_file_reporter_base.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 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 <string>
23
26
27namespace stat_bench {
28namespace reporter {
29
33class DataFileReporterBase : public IReporter {
34public:
40 explicit DataFileReporterBase(std::string file_path);
41
48 virtual void write_data_file(
49 const std::string& file_path, const data_file_spec::RootData& data) = 0;
50
52 void experiment_starts(const clock::SystemTimePoint& time_stamp) final;
53
55 void experiment_finished(const clock::SystemTimePoint& time_stamp) final;
56
58 void measurer_starts(const measurer::MeasurerName& name) final;
59
61 void measurer_finished(const measurer::MeasurerName& name) final;
62
64 void group_starts(const BenchmarkGroupName& name,
65 const bench_impl::BenchmarkGroupConfig& config) final;
66
68 void group_finished(const BenchmarkGroupName& name) final;
69
71 void case_starts(const BenchmarkFullName& case_info) final;
72
74 void case_finished(const BenchmarkFullName& case_info) final;
75
77 void measurement_succeeded(const measurer::Measurement& measurement) final;
78
80 void measurement_failed(const BenchmarkFullName& case_info,
81 const BenchmarkCondition& cond, const std::exception_ptr& error) final;
82
83private:
85 std::string file_path_;
86
89};
90
91} // namespace reporter
92} // 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 measurer_starts(const measurer::MeasurerName &name) final
Start benchmarks using a measurer.
DataFileReporterBase(std::string file_path)
Constructor.
void case_starts(const BenchmarkFullName &case_info) final
Start a case of a benchmark.
virtual void write_data_file(const std::string &file_path, const data_file_spec::RootData &data)=0
Write a data file.
void group_finished(const BenchmarkGroupName &name) final
Finished a group of benchmarks.
void measurement_failed(const BenchmarkFullName &case_info, const BenchmarkCondition &cond, const std::exception_ptr &error) final
Failed a measurement.
void measurer_finished(const measurer::MeasurerName &name) final
Finished benchmarks using a measurer.
void case_finished(const BenchmarkFullName &case_info) final
Finished a case of a benchmark.
void experiment_finished(const clock::SystemTimePoint &time_stamp) final
Finished an experiment.
void experiment_starts(const clock::SystemTimePoint &time_stamp) final
Start an experiment.
void group_starts(const BenchmarkGroupName &name, const bench_impl::BenchmarkGroupConfig &config) final
Start a group of benchmarks.
void measurement_succeeded(const measurer::Measurement &measurement) final
Successfully finished a measurement.
Definition of structs to specify the structure of data files.
Definition of IReporter class.
Namespace of reporters of results of benchmarks.
Namespace of stat_bench source codes.
Struct of root objects in data files.