cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
Loading...
Searching...
No Matches
plot_reporter.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 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 <memory>
23#include <string>
24#include <vector>
25
31
32namespace stat_bench {
33namespace reporter {
34
38class PlotReporter final : public IReporter {
39public:
45 explicit PlotReporter(std::string prefix);
46
48 void experiment_starts(const clock::SystemTimePoint& time_stamp) override;
49
51 void experiment_finished(const clock::SystemTimePoint& time_stamp) override;
52
54 void measurer_starts(const measurer::MeasurerName& name) override;
55
57 void measurer_finished(const measurer::MeasurerName& name) override;
58
60 void group_starts(const BenchmarkGroupName& name,
61 const bench_impl::BenchmarkGroupConfig& config) override;
62
64 void group_finished(const BenchmarkGroupName& name) override;
65
67 void case_starts(const BenchmarkFullName& case_info) override;
68
70 void case_finished(const BenchmarkFullName& case_info) override;
71
74 const measurer::Measurement& measurement) override;
75
77 void measurement_failed(const BenchmarkFullName& case_info,
78 const BenchmarkCondition& cond,
79 const std::exception_ptr& error) override;
80
81private:
83 std::string prefix_;
84
86 measurer::MeasurerName measurer_name_;
87
89 util::Utf8String measurer_name_for_file_paths_;
90
92 std::vector<measurer::Measurement> measurements_{};
93
95 std::vector<std::shared_ptr<plots::IPlot>> builtin_plots_{};
96
98 std::vector<std::shared_ptr<plots::IPlot>> group_plots_{};
99};
100
101} // namespace reporter
102} // 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) override
Start benchmarks using a measurer.
void group_starts(const BenchmarkGroupName &name, const bench_impl::BenchmarkGroupConfig &config) override
Start a group of benchmarks.
void case_finished(const BenchmarkFullName &case_info) override
Finished a case of a benchmark.
void measurer_finished(const measurer::MeasurerName &name) override
Finished benchmarks using a measurer.
PlotReporter(std::string prefix)
Constructor.
void experiment_starts(const clock::SystemTimePoint &time_stamp) override
Start an experiment.
void case_starts(const BenchmarkFullName &case_info) override
Start a case of a benchmark.
void measurement_succeeded(const measurer::Measurement &measurement) override
Successfully finished a measurement.
void group_finished(const BenchmarkGroupName &name) override
Finished a group of benchmarks.
void measurement_failed(const BenchmarkFullName &case_info, const BenchmarkCondition &cond, const std::exception_ptr &error) override
Failed a measurement.
void experiment_finished(const clock::SystemTimePoint &time_stamp) override
Finished an experiment.
Class of UTF-8 encoded string.
Definition utf8_string.h:35
Definition of IPlot class.
Definition of IReporter class.
Definition of Measurement class.
Definition of MeasurerName class.
Namespace of reporters of results of benchmarks.
Namespace of stat_bench source codes.
Definition of Utf8String class.