From 75767a3a977a5c71adebaaeb40e09d4dae4fa843 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 19 Sep 2021 17:31:54 +0200 Subject: [PATCH] capture and store individual timings as time series Note: work-in-progress... TODO: derive the expense factor and delta --- yoshimi-testrunner/src/util/data.hpp | 2 +- yoshimi-testrunner/src/util/format.hpp | 5 ++ yoshimi-testrunner/src/util/statistic.cpp | 57 +++++++++++++++++++++++ yoshimi-testrunner/src/util/statistic.hpp | 56 ++++++++++++++++++++++ 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 yoshimi-testrunner/src/util/statistic.cpp create mode 100644 yoshimi-testrunner/src/util/statistic.hpp diff --git a/yoshimi-testrunner/src/util/data.hpp b/yoshimi-testrunner/src/util/data.hpp index f109d0a03..dee0710c5 100644 --- a/yoshimi-testrunner/src/util/data.hpp +++ b/yoshimi-testrunner/src/util/data.hpp @@ -49,7 +49,7 @@ ** Column x{"X value"}; ** Column y{"Y value"}; ** - ** auto allColumns(){ return std::tie(name,count,x,y); } + ** auto allColumns(){ return std::tie(name,n,x,y); } ** }; ** ** using Dataz = util::DataFile; diff --git a/yoshimi-testrunner/src/util/format.hpp b/yoshimi-testrunner/src/util/format.hpp index 645ee5c01..82124aca0 100644 --- a/yoshimi-testrunner/src/util/format.hpp +++ b/yoshimi-testrunner/src/util/format.hpp @@ -96,6 +96,11 @@ inline bool parseAs(string const& encodedBool) { return util::boolVal(encodedBool); } +template<> +inline string parseAs(string const& string) +{ + return string; // pass-through (even if empty) +} diff --git a/yoshimi-testrunner/src/util/statistic.cpp b/yoshimi-testrunner/src/util/statistic.cpp new file mode 100644 index 000000000..22c3d21f0 --- /dev/null +++ b/yoshimi-testrunner/src/util/statistic.cpp @@ -0,0 +1,57 @@ +/* + * statistic - helpers for generic statistics calculations + * + * Copyright 2021, Hermann Vosseler + * + * This file is part of the Yoshimi-Testsuite, which is free software: + * you can redistribute and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * Yoshimi-Testsuite is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with yoshimi. If not, see . + ***************************************************************/ + + +/** @file statistic.cpp + ** Implementation details for generic statistics calculations. + ** + ** @todo WIP as of 9/21 + ** + */ + + +#include "util/statistic.hpp" +//#include "util/format.hpp" +#include "util/error.hpp" + +//#include +//#include +//#include + + +namespace util { + +//using util::formatVal; +//using std::log10; +//using std::fabs; +//using std::max; +//using std::min; + + +namespace { // Implementation details +}//(End)Implementation namespace + + + + +/** + */ + + +}//(End)namespace util diff --git a/yoshimi-testrunner/src/util/statistic.hpp b/yoshimi-testrunner/src/util/statistic.hpp new file mode 100644 index 000000000..03d239a13 --- /dev/null +++ b/yoshimi-testrunner/src/util/statistic.hpp @@ -0,0 +1,56 @@ +/* + * statistic - helpers for generic statistics calculations + * + * Copyright 2021, Hermann Vosseler + * + * This file is part of the Yoshimi-Testsuite, which is free software: + * you can redistribute and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * Yoshimi-Testsuite is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with yoshimi. If not, see . + ***************************************************************/ + + +/** @file statistic.cpp + ** Support for generic statistics calculations. + ** + ** @todo WIP as of 9/21 + ** + */ + + + +#ifndef TESTRUNNER_UTIL_STATISTIC_HPP_ +#define TESTRUNNER_UTIL_STATISTIC_HPP_ + + +#include "util/error.hpp" + +//#include +//#include +#include +//#include + +namespace util { + +//using util::formatVal; +//using std::log10; +//using std::fabs; +//using std::max; +//using std::min; + +using VecD = std::vector; + +namespace { // Implementation details +}//(End)Implementation namespace + + +}//(End)namespace util +#endif /*TESTRUNNER_UTIL_STATISTIC_HPP_*/