Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
CaptureSet.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Framework_SystemPerformance_CaptureSet_h_
5#define _Stroika_Framework_SystemPerformance_CaptureSet_h_ 1
6
7#include "Stroika/Frameworks/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Common/Property.h"
10#include "Stroika/Foundation/Containers/Set.h"
12
13#include "Instrument.h"
14
15/**
16 */
17
18namespace Stroika::Frameworks::SystemPerformance {
19
20 using namespace Stroika::Foundation;
22 using Containers::Set;
23 using Time::Duration;
24
25 /**
26 * This is a collection of instruments (which are in turn sets of measureables) all collected on a common
27 * time period.
28 *
29 * \note \em Thread-Safety <a href="Thread-Safety.md#C++-Standard-Thread-Safety">C++-Standard-Thread-Safety</a>
30 */
31 class CaptureSet {
32 public:
33 /**
34 */
35 CaptureSet (const Duration& period = 30s, const Set<Instrument>& instruments = {});
36 CaptureSet (const CaptureSet& src);
37
38 public:
39 nonvirtual CaptureSet& operator= (const CaptureSet& rhs);
40
41 public:
42 /**
43 * @brief All the Instruments have their data 'captured' automatically every 'run-period' time interval.
44 *
45 * So, in particular, any averages captured will generally, by default, be relative to this interval
46 * (unless the instrument documents a different pattern, such as load-average).
47 */
49
50 public:
51 /**
52 * @brief This is the set of instruments which will be captured on the regular interval basis
53 */
55
56 public:
57 /**
58 */
59 nonvirtual void AddInstrument (const Instrument& i);
60
61 private:
62 Set<Instrument> fInstruments_;
63 Duration fPeriod_;
64 };
65
66}
67
68/*
69 ********************************************************************************
70 ***************************** Implementation Details ***************************
71 ********************************************************************************
72 */
73#include "CaptureSet.inl"
74
75#endif /*_Stroika_Framework_SystemPerformance_CaptureSet_h_*/
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
Definition Set.h:105
Duration is a chrono::duration<double> (=.
Definition Duration.h:96
Common::Property< Duration > runPeriod
All the Instruments have their data 'captured' automatically every 'run-period' time interval.
Definition CaptureSet.h:48
Common::Property< Set< Instrument > > instruments
This is the set of instruments which will be captured on the regular interval basis.
Definition CaptureSet.h:54
An Instrument is a stateful object from which you can Capture () a series of measurements about a sys...
Definition Instrument.h:69