diff --git a/src/lib/incidence-count.hpp b/src/lib/incidence-count.hpp new file mode 100644 index 000000000..5c2cde713 --- /dev/null +++ b/src/lib/incidence-count.hpp @@ -0,0 +1,59 @@ +/* + INCIDENCE-COUNT.hpp - instrumentation helper to watch possibly multithreaded task activations + + Copyright (C) Lumiera.org + 2024, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file incidence-count.hpp + ** Record and evaluate concurrent activations. + ** This observation and instrumentation helper is typically used to capture + ** density of incidence and effective concurrency of performance critical tasks. + ** The overhead per measurement call amounts to one SystemClock invocation plus + ** some heap memory access, assuming that sufficient memory was pre-allocated + ** prior to the actual observation phase. Moreover, on first invocation per Thread, + ** a thread local ID is constructed, thereby incrementing an global atomic counter. + ** Statistics evaluation is comprised of integrating and sorting the captured + ** event log, followed by a summation pass. + ** @see IncidenceCount_test + ** @see vault::gear::TestChainLoad::ScheduleCtx + ** @see SchedulerStress_test + */ + + +#ifndef LIB_INCIDENCE_COUNT_H +#define LIB_INCIDENCE_COUNT_H + + +//#include "lib/meta/function.hpp" + +//#include + + +namespace lib { + +// using std::forward; + + class IncidenceCount + { + public: + }; + + +} // namespace lib +#endif /*LIB_INCIDENCE_COUNT_H*/ diff --git a/tests/15library.tests b/tests/15library.tests index aed131076..ecc06158f 100644 --- a/tests/15library.tests +++ b/tests/15library.tests @@ -424,6 +424,11 @@ return: 0 END +PLANNED "Instrumentation: concurrent calls" IncidenceCount_test < + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +/** @file incidence-count-test.cpp + ** unit test \ref IncidenceCount_test + */ + + +#include "lib/test/run.hpp" +#include "lib/format-cout.hpp"//////////////TODO RLY? +#include "lib/incidence-count.hpp" + +//#include +#include + + +//using std::string; +using std::this_thread::sleep_for; + + +namespace lib { +namespace test{ + + + + + /***************************************************************************//** + * @test verifies capturing and restoring of std::ostream formatting state. + * @see ios-savepoint.hpp + */ + class IncidenceCount_test + : public Test + { + void + run (Arg) + { + demonstrate_usage(); + verify_incidentCount(); + verify_multithreadCount(); + } + + + + /** @test TODO + * @todo WIP 2/24 🔁 define ⟶ implement + */ + void + demonstrate_usage() + { + } + + + /** @test TODO verify proper counting of possibly overlapping incidences + * @todo WIP 2/24 🔁 define ⟶ implement + */ + void + verify_incidentCount() + { + UNIMPLEMENTED("verify proper counting of possibly overlapping incidences"); + } + + + /** @test TODO verify thread-safe operation under pressure + * @todo WIP 2/24 🔁 define ⟶ implement + */ + void + verify_multithreadCount() + { + UNIMPLEMENTED("verify thread-safe operation under pressure"); + } + }; + + LAUNCHER (IncidenceCount_test, "unit common"); + + +}} // namespace lib::test + diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 726e3e1a2..4b454738e 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -110897,8 +110897,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
Fokus ⟹ Ziel ⟹ es geht um Halten ⟷ Brechen

- - + @@ -110932,6 +110931,176 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + +

+ Zwar ist die ComputationalLoad auf die jeweilige Hardware dynamisch geeicht, aber in den Einzelbeobachtungen habe ich immer ganz erhebliche Abweichungen für Node-Aufrufe mit Load gesehen. Daher ist die Frage, wie verhält sich die insgesamt (kumuliert, d.h. integriert) verbrachte Zeit zu der nominell geeichten Zeit? Daraus ergäbe sich ein Korrektur-Faktor, den man aus dem StressFac herausrechnen könnte +

+ + +
+
+ + + + + + + + +

+ Untersuchung per Godbolt.org : SystemClock-Aufrufe werden nicht wegoptimiert +

+ + +
+ + + + + +

+ ...das ist überraschend, denn sonst wird wirklich alles wie erwartet eingedampft und es bleibt nur die eigentliche Nutzfunktion übrig; der Grund ist aber leicht einzusehen: es handelt sich um einen externen Call, der Seiteneffekte haben könnte. +

+ + +
+
+
+ + + + +
+ + + + + + + + + + + + + + + + +

+ das bedeutet: jeder Thread hat seinen eigenen »Slot«, den er ohne jedwede Synchronisation zugreifen kann +

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +