![]() |
JODA
0.13.1 (59b41972)
JSON On-Demand Analysis
|
#include <Benchmark.h>
Public Member Functions | |
| Benchmark () | |
| Benchmark (const std::string &file) | |
| Benchmark (const Benchmark &b)=delete | |
| Benchmark & | operator= (const Benchmark &b)=delete |
| Benchmark (Benchmark &&b) | |
| Benchmark & | operator= (Benchmark &&b) |
| virtual | ~Benchmark () |
| template<typename T > | |
| void | addValue (const std::string &header, T &&val) |
| template<typename T > | |
| void | addValue (const std::string &prefix, const std::string &header, T &&val) |
| template<typename T > | |
| void | addValueAt (const std::string &pointer, T &&val) |
| template<typename T > | |
| void | addValueAt (const RJPointer &pointer, T &&val) |
| void | addThread (double bloom, double select, double project, double agg, double copy, double serialize, double sample_view_cost) |
| void | finishLine () |
| std::string | toString () const |
| std::string | lastLineToString () const |
| const RJValue & | getLastLine () const |
| std::string | currentLineToString () const |
| bool | isValid () const |
Static Public Attributes | |
| static constexpr auto | RUNTIME = "/Runtime" |
| static constexpr auto | THREADS = "/Runtime/Threads" |
Protected Member Functions | |
| void | parseBenchfile () |
| void | writeBenchfile () const |
Protected Attributes | |
| std::mutex | mut |
| RJDocument | benchDoc |
| RJValue | currentLine |
| bool | valid = false |
| bool = true | |
| fs::path | benchfile |
The Benchmark class is mainly used to manage the measured execution times of queries. But additional information can also be stored in the benchmark class.
The benchmark file is a JSON document where the top-level entry is an array. This array then contains one benchmark "line" for each query execution.
| Benchmark::Benchmark | ( | ) |
Initializes an in-memory benchmark document. This can be used to display collected informations in CLI
|
explicit |
Initializes an benchmark document on the filesystem. If the file already exists it is parsed into a JSON document. If this is not a valid benchmark file, an error will be logged and the benchmark will only be in-memory instead.
| file | The path to the file, where the benchmark should be stored. |
|
delete |
| Benchmark::Benchmark | ( | Benchmark && | b | ) |
|
virtual |
If the benchmark is stored on the filesystem, the file will be flushed and closed. If not, all data is simply discarded.
| void Benchmark::addThread | ( | double | bloom, |
| double | select, | ||
| double | project, | ||
| double | agg, | ||
| double | copy, | ||
| double | serialize, | ||
| double | sample_view_cost | ||
| ) |
Adds a new entry in the "thread" attribute with the given values
|
inline |
Adds a value of type T at the JSON path "/<header>"
| header | The attribute name to be stored |
| val | The value to be stored |
|
inline |
Adds a value of type T at the JSON path "<prefix>/<header>"
| prefix | The attribute prefix to be stored |
| header | The attribute name to be stored |
| val | The value to be stored |
|
inline |
Adds a value of type T at the JSON pointer (in string representation) "pointer"
| pointer | The pointer where the value will be stored |
| val | The value to be stored |
|
inline |
Adds a value of type T at the JSON pointer (in string representation) "pointer"
| pointer | The pointer where the value will be stored |
| val | The value to be stored |
| std::string Benchmark::currentLineToString | ( | ) | const |
Stringifies the current benchmark line and returns it.
| void Benchmark::finishLine | ( | ) |
Completes, and optionally flushes, one line in the benchmark array-document. A new line is created for further use.
| const RJValue & Benchmark::getLastLine | ( | ) | const |
Returns the last benchmark line If no line exists before the current one, a null value is returned.
| bool Benchmark::isValid | ( | ) | const |
Checks whether the benchmark is in a valid format. If not, all operations on it are no-ops
| std::string Benchmark::lastLineToString | ( | ) | const |
Stringifies the last benchmark line and returns it. If no line exists before the current one, an empty string is returned.
|
protected |
| std::string Benchmark::toString | ( | ) | const |
Stringifies the current benchmark file with all lines and returns it.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexpr |
|
staticconstexpr |
|
protected |